From 87a8b066a3bddf701ee1130e9113be2ff690d802 Mon Sep 17 00:00:00 2001 From: imn Date: Tue, 3 Nov 2015 16:30:08 +0300 Subject: [PATCH] Fix crash of SALOME GUI on start in GCC4.8 and older with C++11 activated option. --- src/Session/Session_ServerCheck.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ); -- 2.39.2