]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modmanager_dynamic.cpp
Fix build error
[user/henk/code/inspircd.git] / src / modmanager_dynamic.cpp
index 0c63eefcd0cab6f918f8042387bcbf9b354ac86c..fa6b119a025234bd9b7feaade560663aebae3196 100644 (file)
@@ -44,6 +44,8 @@ bool ModuleManager::Load(const char* filename)
                        dirent* entry = NULL;
                        while (0 != (entry = readdir(library)))
                        {
+                               if (entry->d_name[0] == '.')
+                                       continue;
                                if (InspIRCd::Match(entry->d_name, filename, ascii_case_insensitive_map))
                                {
                                        if (!this->Load(entry->d_name))
@@ -108,8 +110,8 @@ bool ModuleManager::Load(const char* filename)
                // failure in module constructor
                if (newmod)
                        DoSafeUnload(newmod);
-               delete newmod;
-               delete newhandle;
+               else
+                       delete newhandle;
                LastModuleError = "Unable to load " + filename_str + ": " + modexcept.GetReason();
                ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError);
                return false;
@@ -167,7 +169,8 @@ namespace {
                        ServerInstance->GlobalCulls.Apply();
                        delete dll;
                        bool rv = ServerInstance->Modules->Load(name.c_str());
-                       callback->Call(rv);
+                       if (callback)
+                               callback->Call(rv);
                        ServerInstance->GlobalCulls.AddItem(this);
                }
        };