]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
BugID: IPAL12013, Changed method createStudyManager: added a check if the StudyManage...
authorsrn <srn@opencascade.com>
Mon, 27 Mar 2006 07:58:50 +0000 (07:58 +0000)
committersrn <srn@opencascade.com>
Mon, 27 Mar 2006 07:58:50 +0000 (07:58 +0000)
src/SALOMEDS/Makefile.am
src/SALOMEDS/SALOMEDS.cxx

index 7a8263368faa9fea6bdfc33afd5ea48a3721cc0d..f0b80d248a554d02b8d4940b57c268fa221b6165 100644 (file)
@@ -307,7 +307,7 @@ libSalomeDS_la_SOURCES =    \
        SALOMEDS_TMPFile_i.hxx
 
 libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDS_la_LDFLAGS  = -no-undefined -version-info=0:0:0
+libSalomeDS_la_LDFLAGS  = -Wl,-E -no-undefined -version-info=0:0:0 @LDEXPDYNFLAGS@
 libSalomeDS_la_LIBADD    = $(COMMON_LIBS)
 
 #
index 6ea7ac4728d4d18482ab2653a106827e3f4ffb73..c0a6bf3090ac90f0e27fe86784361d13f30c6be6 100644 (file)
@@ -53,6 +53,7 @@
 // IDL headers
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SALOMEDS)
+#include <SALOME_NamingService.hxx>
 
 using namespace SALOMEDS;
 
@@ -122,10 +123,16 @@ SALOMEDSClient_StudyBuilder* BuilderFactory(SALOMEDS::StudyBuilder_ptr theBuilde
 
 SALOMEDSClient_StudyManager* CreateStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
 {
-  SALOMEDS_StudyManager_i * aStudyManager_i = new  SALOMEDS_StudyManager_i(orb, root_poa);
-  // Activate the objects.  This tells the POA that the objects are ready to accept requests.
-  PortableServer::ObjectId_var aStudyManager_iid =  root_poa->activate_object(aStudyManager_i);
-  aStudyManager_i->register_name("/myStudyManager");
+  cout << "############## CreateStudyManager"   << endl;
+  SALOME_NamingService namingService(orb);
+  CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" );
+  SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj );
+  if( CORBA::is_nil(theManager) ) {
+    SALOMEDS_StudyManager_i * aStudyManager_i = new  SALOMEDS_StudyManager_i(orb, root_poa);
+    // Activate the objects.  This tells the POA that the objects are ready to accept requests.
+    PortableServer::ObjectId_var aStudyManager_iid =  root_poa->activate_object(aStudyManager_i);
+    aStudyManager_i->register_name("/myStudyManager");
+  }
   return new SALOMEDS_StudyManager();
 }