From: vsr Date: Tue, 12 Apr 2016 11:56:43 +0000 (+0300) Subject: Allow SALOME session to be closed explicity programmatically, including killing stand... X-Git-Tag: V7_8_0a2^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=88a5e355c9a8da5c4aeba4a3c47a746c56b8e731;p=modules%2Fgui.git Allow SALOME session to be closed explicity programmatically, including killing standalone servers. --- diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 4b583e818..fb06393b1 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -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