Salome HOME
Allow SALOME session to be closed explicity programmatically, including killing stand... V7_8_0a2 V7_8_0b1
authorvsr <vsr@opencascade.com>
Tue, 12 Apr 2016 11:56:43 +0000 (14:56 +0300)
committervsr <vsr@opencascade.com>
Tue, 12 Apr 2016 11:56:43 +0000 (14:56 +0300)
src/Session/SALOME_Session_Server.cxx

index 4b583e8187af45485deedc00238c7caf220daa14..fb06393b1e88758069adcacd126222f9a1d2eefd 100755 (executable)
@@ -574,10 +574,15 @@ int main( int argc, char **argv )
         }
         else {
           // desktop might be closed from:
-          // - StopSesion() /temporarily/ or
-          // - Shutdown() /permanently/
+          // - StopSesion() (temporarily) or
+          // - Shutdown() (permanently)
           stat = session->GetStatSession();
           shutdownSession = stat.state == SALOME::shutdown;
+          // normally "shutdown standalone servers" flag should be false here, if we come from
+          // StopSesion() or from Shutdown();
+          // but we also have to check if somebody explicitly programmatically closed session,
+          // asking to kill servers also
+          shutdownAll = aGUISession->exitFlags();
         }
         if ( shutdownAll || shutdownSession ) {
           _SessionMutex.lock(); // lock mutex before leaving loop - it will be unlocked later