mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use sigFpe::ignore helper class in runTimePostProcessing (issue #897)
This commit is contained in:
@ -145,13 +145,11 @@ bool Foam::functionObjects::runTimePostProcessing::write()
|
|||||||
Info<< type() << " " << name() << " output:" << nl
|
Info<< type() << " " << name() << " output:" << nl
|
||||||
<< " Constructing scene" << endl;
|
<< " Constructing scene" << endl;
|
||||||
|
|
||||||
// Unset any floating point trapping
|
|
||||||
|
// Disable any floating point trapping
|
||||||
// (some low-level rendering functionality does not like it)
|
// (some low-level rendering functionality does not like it)
|
||||||
const bool oldFpe = sigFpe::active();
|
|
||||||
if (oldFpe)
|
sigFpe::ignore sigFpeHandling; //<- disable in local scope
|
||||||
{
|
|
||||||
sigFpe::unset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialise render window
|
// Initialise render window
|
||||||
auto renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
|
auto renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
|
||||||
@ -240,11 +238,12 @@ bool Foam::functionObjects::runTimePostProcessing::write()
|
|||||||
surfaces_[i].clear();
|
surfaces_[i].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore floating point trapping
|
|
||||||
if (oldFpe)
|
// Instead of relying on the destructor, manually restore the previous
|
||||||
{
|
// SIGFPE state.
|
||||||
sigFpe::set();
|
// This is only to avoid compiler complaints about unused variables.
|
||||||
}
|
|
||||||
|
sigFpeHandling.restore();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user