]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/server.cpp
Ensure plugins load their own functions
[xonotic/netradiant.git] / radiant / server.cpp
index 1904867b949c0eeec93aacf717a4853d975f022a..00221d7d7d165f49621a042f8b5bdd73593e19ce 100644 (file)
@@ -32,8 +32,8 @@
 
 class RadiantModuleServer : public ModuleServer
 {
-typedef std::pair<CopiedString, int> ModuleType;
-typedef std::pair<ModuleType, CopiedString> ModuleKey;
+typedef std::pair<std::string, int> ModuleType;
+typedef std::pair<ModuleType, std::string> ModuleKey;
 typedef std::map<ModuleKey, Module*> Modules_;
 Modules_ m_modules;
 bool m_error;
@@ -151,7 +151,13 @@ public:
 typedef int ( *FunctionPointer )();
 
 DynamicLibrary( const char* filename ){
-       m_library = dlopen( filename, RTLD_NOW );
+       m_library = dlopen( filename, RTLD_NOW|RTLD_LOCAL|RTLD_DEEPBIND );
+       if ( !m_library )
+       {
+               globalErrorStream() << "LoadLibrary failed: '" << filename << "'\n";
+               if ( const char* error = dlerror() )
+                       globalErrorStream() << "GetLastError: " << error;
+       }
 }
 ~DynamicLibrary(){
        if ( !failed() ) {