From 99949a7c43afd6954904508c24be22aaf266982d Mon Sep 17 00:00:00 2001 From: srn Date: Tue, 28 Feb 2006 11:48:39 +0000 Subject: [PATCH] Added a flag RTLD to dlopen --- src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx | 10 +++++----- src/SALOMEDSClient/SALOMEDSClient_definitions.hxx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx b/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx index b675af16b..4b5e23b59 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx +++ b/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx @@ -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 diff --git a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx index 825979ad0..5a83b9fb3 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx @@ -41,7 +41,7 @@ public: template clt_shared_ptr & operator=(clt_shared_ptr const & r) { - clt_shared_ptr(r).swap(*this); + clt_shared_ptr(r,boost::detail::dynamic_cast_tag()).swap(*this); return *this; } -- 2.39.2