Salome HOME
23514: EDF 16031 - SMESH freezes
[modules/kernel.git] / src / Launcher / SALOME_LauncherServer.cxx
index 4bb4ecfd9d13c1e991c17c1bec5f92fb0893ac4e..a82d900507122e508994a4c6c3b250d748e4d640 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -21,6 +21,7 @@
 //
 
 #include "SALOME_Launcher.hxx"
+#include "SALOMESDS_DataServerManager.hxx"
 #include "utilities.h"
 #include <sstream>
 #include <iostream>
@@ -85,18 +86,26 @@ int main(int argc, char* argv[])
     if(!CORBA::is_nil(obj))
       root_poa = PortableServer::POA::_narrow(obj);
     if(!CORBA::is_nil(root_poa))
-      pman = root_poa->the_POAManager();
+      {
+        pman = root_poa->the_POAManager();
+        pman->activate();
+      }
   }
   catch(CORBA::COMM_FAILURE&){
     MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
   }
-  try{
-    SALOME_Launcher *lServ=new SALOME_Launcher(orb,root_poa);
-    pman->activate();
-    lServ->_remove_ref();
-    orb->run();
-    orb->destroy();
-  }catch(CORBA::SystemException&){
+  try
+    {
+      SALOME_Launcher *lServ(new SALOME_Launcher(orb,root_poa));
+      lServ->_remove_ref();
+      //
+      SALOMESDS::DataServerManager *dsm(new SALOMESDS::DataServerManager(argc,argv,orb,root_poa));
+      dsm->_remove_ref();
+      //
+      orb->run();
+      orb->destroy();
+    }
+  catch(CORBA::SystemException&){
     MESSAGE("Caught CORBA::SystemException.");
   }catch(PortableServer::POA::WrongPolicy&){
     MESSAGE("Caught CORBA::WrongPolicyException.");