X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_ModuleReader.cpp;h=f2fcda4b717278ae83d5787a0d497623b47bcb95;hb=87c2d038fe6feaae3951850cbfb43313015aa1f7;hp=0291b83b4db3039eb1fe97a22d37c8153e66bb6f;hpb=218ccacb26759956e95a7e7aa0b375fcf054ec1b;p=modules%2Fshaper.git diff --git a/src/Config/Config_ModuleReader.cpp b/src/Config/Config_ModuleReader.cpp index 0291b83b4..f2fcda4b7 100644 --- a/src/Config/Config_ModuleReader.cpp +++ b/src/Config/Config_ModuleReader.cpp @@ -24,7 +24,8 @@ #endif Config_ModuleReader::Config_ModuleReader(const char* theEventGenerated) - : Config_XMLReader("plugins.xml"), myEventGenerated(theEventGenerated) + : Config_XMLReader("plugins.xml"), + myEventGenerated(theEventGenerated) { } @@ -57,7 +58,7 @@ void Config_ModuleReader::processNode(xmlNodePtr theNode) std::string aPluginLibrary = getProperty(theNode, PLUGIN_LIBRARY); std::list aFeatures = importPlugin(aPluginLibrary, aPluginConf); std::list::iterator it = aFeatures.begin(); - for(; it != aFeatures.end(); it++) { + for (; it != aFeatures.end(); it++) { myFeaturesInFiles[*it] = aPluginConf; } } @@ -71,7 +72,7 @@ bool Config_ModuleReader::processChildren(xmlNodePtr theNode) std::list Config_ModuleReader::importPlugin(const std::string& thePluginLibrary, const std::string& thePluginFile) { - if (thePluginFile.empty()) { //probably a third party library + if (thePluginFile.empty()) { //probably a third party library loadLibrary(thePluginLibrary); return std::list(); } @@ -84,23 +85,20 @@ std::list Config_ModuleReader::importPlugin(const std::string& theP void Config_ModuleReader::loadLibrary(const std::string theLibName) { -#ifdef _DEBUG - std::cout << "Config_ModuleReader::loading library... " << theLibName.c_str() << std::endl; -#endif std::string aFileName = library(theLibName); if (aFileName.empty()) return; #ifdef WIN32 HINSTANCE aModLib = ::LoadLibrary(aFileName.c_str()); - if (!aModLib) { + if (!aModLib && theLibName != "DFBrowser") { // don't shor error for internal debugging tool std::string errorMsg = "Failed to load " + aFileName; std::cerr << errorMsg << std::endl; Events_Error::send(errorMsg); } #else - void* aModLib = dlopen( aFileName.c_str(), RTLD_LAZY ); - if ( !aModLib ) { + void* aModLib = dlopen( aFileName.c_str(), RTLD_LAZY | RTLD_GLOBAL ); + if ( !aModLib && theLibName != "DFBrowser") { // don't shor error for internal debugging tool std::cerr << "Failed to load " << aFileName.c_str() << std::endl; } #endif