From 88a5e355c9a8da5c4aeba4a3c47a746c56b8e731 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 12 Apr 2016 14:56:43 +0300 Subject: [PATCH] Allow SALOME session to be closed explicity programmatically, including killing standalone servers. --- src/Session/SALOME_Session_Server.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 2.39.2