From: imn Date: Tue, 3 Nov 2015 13:30:08 +0000 (+0300) Subject: Fix crash of SALOME GUI on start in GCC4.8 and older with C++11 activated option. X-Git-Tag: V8_0_0a1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=87a8b066a3bddf701ee1130e9113be2ff690d802;p=modules%2Fgui.git Fix crash of SALOME GUI on start in GCC4.8 and older with C++11 activated option. --- diff --git a/src/Session/Session_ServerCheck.cxx b/src/Session/Session_ServerCheck.cxx index 3f0fc2954..2789e23a8 100644 --- a/src/Session/Session_ServerCheck.cxx +++ b/src/Session/Session_ServerCheck.cxx @@ -71,6 +71,15 @@ const int __DEFAULT__ATTEMPTS__ = 300; */ const int __DEFAULT__DELAY__ = 50000; +// The exception being thrown out of a destructor, +// that is not allowed by default in C++11. + +#if __cplusplus >= 201103L +# define TYPE_NOEXCEPT noexcept(false) +#else +# define TYPE_NOEXCEPT +#endif + /*! \classSession_ServerCheck::Locker \brief Automatic locker/unlocker. @@ -92,7 +101,7 @@ public: /*! \brief Destructor. Wakes the calling thread and goes sleeping. */ - ~Locker() + ~Locker() TYPE_NOEXCEPT { myChecker->myWC->wakeAll(); myChecker->usleep( myChecker->myDelay );