]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0021688: [CEA 572] Issue when using runSalome -k -t
authorvsr <vsr@opencascade.com>
Tue, 13 Nov 2012 08:47:17 +0000 (08:47 +0000)
committervsr <vsr@opencascade.com>
Tue, 13 Nov 2012 08:47:17 +0000 (08:47 +0000)
src/Session/SALOME_Session_Server.cxx
src/Session/Session_ServerLauncher.cxx
src/Session/Session_ServerLauncher.hxx
src/Session/Session_ServerThread.cxx
src/Session/Session_ServerThread.hxx

index f94e9a639cc2f4f90ee816027903764e643177d2..a0c6f883347f69b5a25b1d84ce7464e445ce9de4 100755 (executable)
@@ -659,11 +659,14 @@ int main( int argc, char **argv )
   // unlock Session mutex
   _SessionMutex.unlock();
   
-  if ( shutdownAll )
+  if ( myServerLauncher )
+    myServerLauncher->ShutdownAll(); // shutdown embedded servers
+
+  if ( shutdownAll )                 // shutdown standalone servers
     shutdownServers( _NS );
 
   if ( myServerLauncher )
-    myServerLauncher->KillAll(); // kill embedded servers
+    myServerLauncher->KillAll();     // kill embedded servers
 
   // Unregister session server
   SALOME_Session_i* sessionServant = dynamic_cast<SALOME_Session_i*>( poa->reference_to_servant( session.in() ) );
index 39c9c5ef6752a1f3c553ef45e048cbf4fc6f8396..9a442e9f760d0f35e327b50df8dee42648091e26 100755 (executable)
@@ -230,6 +230,16 @@ void Session_ServerLauncher::ActivateAll()
   delete[] argv;
 }
 
+void Session_ServerLauncher::ShutdownAll()
+{
+  MESSAGE("Session_ServerLauncher::ShutdownAll()");
+  std::list<Session_ServerThread*>::reverse_iterator itServ;
+  for (itServ = _serverThreads.rbegin(); itServ !=_serverThreads.rend(); itServ++)
+  {
+    (*itServ)->Shutdown();
+  }
+}
+
 /*! 
   Destruction des classes serveur dans l'ordre inverse de creation
 */
index 39b9eaa834a3a6253f6187eba0cc9c2ce1ea5811..c2cd32176aff3ff5afe53e65ffcf2b0ee42d6042 100755 (executable)
@@ -67,6 +67,7 @@ public:
                          QWaitCondition *SessionStarted);
   virtual ~Session_ServerLauncher();
   void run();
+  void ShutdownAll();
   void KillAll();
 
 protected:
index 07e1e6726991ae1569e77eb800ec2b6341532399..341231c87d35c47091de52838de4f5da92864073 100755 (executable)
@@ -84,6 +84,7 @@ Session_ServerThread::Session_ServerThread(int argc,
   _servType =-1;
   _NS = new SALOME_NamingService(_orb); // one instance per server to limit
                                         // multi thread coherence problems
+  _container = 0;                       // embedded container
 }
 
 /*! 
@@ -165,6 +166,11 @@ void Session_ServerThread::Init()
   }
 }
 
+void Session_ServerThread::Shutdown()
+{
+  if ( _container ) _container->Shutdown();
+}
+
 void Session_ServerThread::ActivateModuleCatalog(int argc,
                                                  char ** argv)
 {
@@ -356,7 +362,7 @@ void Session_ServerThread::ActivateContainer(int argc,
       containerName = argv[1];
     }
     
-    new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
+    _container = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
   }
   catch(CORBA::SystemException&) {
     INFOS("Caught CORBA::SystemException.");
index e6a970008c5ebc1adbd659380217afe36db1d534..46bd6d3cd9d88abe211d3a619f7cfbd3dc46f7f0 100755 (executable)
@@ -35,6 +35,7 @@
 void WaitForServerReadiness(std::string serverName);
 
 class SALOME_NamingService;
+class Engines_Container_i;
 
 class SESSION_EXPORT Session_ServerThread
 {
@@ -49,6 +50,7 @@ public:
                        PortableServer::POA_ptr poa);
   virtual ~Session_ServerThread();
   void         Init();
+  void         Shutdown();
 protected:
   void         ActivateModuleCatalog   ( int argc, char ** argv );
   void         ActivateSALOMEDS        ( int argc, char ** argv );
@@ -64,6 +66,7 @@ protected:
   CORBA::ORB_var          _orb;
   PortableServer::POA_var _root_poa;
   SALOME_NamingService *  _NS;
+  Engines_Container_i*    _container;
 };
 
 class QMutex;