From 3950fc6d81e639f5bd1319e6df7702d28df0b122 Mon Sep 17 00:00:00 2001 From: srn Date: Mon, 27 Mar 2006 07:58:50 +0000 Subject: [PATCH] BugID: IPAL12013, Changed method createStudyManager: added a check if the StudyManager is already launched. Added linker flags to allow the library to export dynamically all defined methods. --- src/SALOMEDS/Makefile.am | 2 +- src/SALOMEDS/SALOMEDS.cxx | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/SALOMEDS/Makefile.am b/src/SALOMEDS/Makefile.am index 7a8263368..f0b80d248 100644 --- a/src/SALOMEDS/Makefile.am +++ b/src/SALOMEDS/Makefile.am @@ -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) # diff --git a/src/SALOMEDS/SALOMEDS.cxx b/src/SALOMEDS/SALOMEDS.cxx index 6ea7ac472..c0a6bf309 100644 --- a/src/SALOMEDS/SALOMEDS.cxx +++ b/src/SALOMEDS/SALOMEDS.cxx @@ -53,6 +53,7 @@ // IDL headers #include #include CORBA_SERVER_HEADER(SALOMEDS) +#include 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(); } -- 2.39.2