From: msv Date: Wed, 26 Apr 2006 14:14:07 +0000 (+0000) Subject: work around PAL12004 "VTK window => SIGFPE Arithmetic Exception Detected" X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c7a8b642ef896f8ec647695408db53cf3c9bde47;p=modules%2Fgui.git work around PAL12004 "VTK window => SIGFPE Arithmetic Exception Detected" --- diff --git a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx index 16b5004ce..6059ff19b 100644 --- a/src/SalomeApp/SalomeApp_ExceptionHandler.cxx +++ b/src/SalomeApp/SalomeApp_ExceptionHandler.cxx @@ -77,5 +77,17 @@ bool SalomeApp_ExceptionHandler::handle( QObject* o, QEvent* e ) /*!Create new SUIT_ExceptionHandler*/ extern "C" SALOMEAPP_EXPORT SUIT_ExceptionHandler* getExceptionHandler() { - return new SalomeApp_ExceptionHandler( true ); + // MSV 2006-04-26: work around PAL12004 "VTK window => SIGFPE Arithmetic Exception Detected" + // We disable FPE signal as it was in earlier versions of SALOME. It is enabled + // only in debug mode if the environment variable DISABLE_FPE is not set to 1. + bool raiseFPE; +#ifdef _DEBUG_ + raiseFPE = true; + char* envDisableFPE = getenv("DISABLE_FPE"); + if (envDisableFPE && atoi(envDisableFPE)) + raiseFPE = false; +#else + raiseFPE = false; +#endif + return new SalomeApp_ExceptionHandler( raiseFPE ); }