]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Added a flag RTLD to dlopen
authorsrn <srn@opencascade.com>
Tue, 28 Feb 2006 11:48:39 +0000 (11:48 +0000)
committersrn <srn@opencascade.com>
Tue, 28 Feb 2006 11:48:39 +0000 (11:48 +0000)
src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx
src/SALOMEDSClient/SALOMEDSClient_definitions.hxx

index b675af16b1c7b7a0ead26827529080b37319d7ae..4b5e23b5921a62becc5f50ad46c9a18bd4fe857e 100644 (file)
@@ -38,7 +38,7 @@ _PTR(SObject) ClientFactory::SObject(SALOMEDS::SObject_ptr theSObject)
   if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
   if(!aSObjectFactory) aSObjectFactory = (SOBJECT_FACTORY_FUNCTION)::GetProcAddress(_libHandle, SOBJECT_FACTORY);
 #else
-  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY);
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
   if(!aSObjectFactory) aSObjectFactory = (SOBJECT_FACTORY_FUNCTION) dlsym(_libHandle, SOBJECT_FACTORY);
 #endif
 
@@ -54,7 +54,7 @@ _PTR(SComponent) ClientFactory::SComponent(SALOMEDS::SComponent_ptr theSComponen
   if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
   if(!aSComponentFactory) aSComponentFactory = (SCOMPONENT_FACTORY_FUNCTION)::GetProcAddress(_libHandle, SCOMPONENT_FACTORY);
 #else
-  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY);
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
   if(!aSComponentFactory) aSComponentFactory = (SCOMPONENT_FACTORY_FUNCTION) dlsym(_libHandle, SCOMPONENT_FACTORY);
 #endif
 
@@ -70,7 +70,7 @@ _PTR(Study) ClientFactory::Study(SALOMEDS::Study_ptr theStudy)
   if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
   if(!aStudyFactory) aStudyFactory = (STUDY_FACTORY_FUNCTION)::GetProcAddress(_libHandle, STUDY_FACTORY);
 #else
-  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY);
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
   if(!aStudyFactory) aStudyFactory = (STUDY_FACTORY_FUNCTION) dlsym(_libHandle, STUDY_FACTORY);
 #endif
 
@@ -86,7 +86,7 @@ _PTR(StudyManager) ClientFactory::StudyManager()
   if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
   if(!aManagerFactory) aManagerFactory = (STUDYMANAGER_FACTORY_FUNCTION)::GetProcAddress(_libHandle, STUDYMANAGER_FACTORY);
 #else
-  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY);
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
   if(!aManagerFactory) aManagerFactory = (STUDYMANAGER_FACTORY_FUNCTION) dlsym(_libHandle, STUDYMANAGER_FACTORY);
 #endif
 
@@ -102,7 +102,7 @@ _PTR(StudyManager) ClientFactory::createStudyManager(CORBA::ORB_ptr orb, Portabl
   if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
   if(!aCreateFactory) aCreateFactory = (STUDYMANAGER_CREATE_FUNCTION)::GetProcAddress(_libHandle, STUDYMANAGER_CREATE);
 #else
-  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY);
+  if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
   if(!aCreateFactory) aCreateFactory = (STUDYMANAGER_CREATE_FUNCTION) dlsym(_libHandle, STUDYMANAGER_CREATE);
 #endif
 
index 825979ad05b0ffe684de9d6bf6e3ff256f085ec6..5a83b9fb33fc259d55bd01be081a4ce6b7183476 100644 (file)
@@ -41,7 +41,7 @@ public:
   template<class Y>
     clt_shared_ptr & operator=(clt_shared_ptr<Y> const & r)
       {
-       clt_shared_ptr<T>(r).swap(*this);
+       clt_shared_ptr<T>(r,boost::detail::dynamic_cast_tag()).swap(*this);
        return *this;
       }