]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modmanager_dynamic.cpp
Merge pull request #416 from SaberUK/insp20+clang42-warnings
[user/henk/code/inspircd.git] / src / modmanager_dynamic.cpp
index 27da56c692ab32f9a779403563d02b7d9082b9b6..dab1143adc8567aaf103c2b1ba1c396d5ad7e100 100644 (file)
@@ -94,7 +94,10 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
        {
                // failure in module constructor
                if (newmod)
+               {
                        DoSafeUnload(newmod);
+                       ServerInstance->GlobalCulls.AddItem(newhandle);
+               }
                else
                        delete newhandle;
                LastModuleError = "Unable to load " + filename + ": " + modexcept.GetReason();
@@ -201,7 +204,7 @@ void ModuleManager::LoadAll()
                                if (!Load(entry->d_name, true))
                                {
                                        ServerInstance->Logs->Log("MODULE", DEFAULT, this->LastError());
-                                       std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << this->LastError() << std::endl << std::endl;
+                                       std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << this->LastError() << std::endl << std::endl;
                                        ServerInstance->Exit(EXIT_STATUS_MODULE);
                                }
                        }
@@ -220,7 +223,7 @@ void ModuleManager::LoadAll()
                if (!this->Load(name, true))
                {
                        ServerInstance->Logs->Log("MODULE", DEFAULT, this->LastError());
-                       std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << this->LastError() << std::endl << std::endl;
+                       std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << this->LastError() << std::endl << std::endl;
                        ServerInstance->Exit(EXIT_STATUS_MODULE);
                }
        }
@@ -228,7 +231,7 @@ void ModuleManager::LoadAll()
        for(std::map<std::string, Module*>::iterator i = Modules.begin(); i != Modules.end(); i++)
        {
                Module* mod = i->second;
-               try 
+               try
                {
                        ServerInstance->Logs->Log("MODULE", DEBUG, "Initializing %s", i->first.c_str());
                        mod->init();
@@ -237,7 +240,7 @@ void ModuleManager::LoadAll()
                {
                        LastModuleError = "Unable to initialize " + mod->ModuleSourceFile + ": " + modexcept.GetReason();
                        ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError);
-                       std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << LastModuleError << std::endl << std::endl;
+                       std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << LastModuleError << std::endl << std::endl;
                        ServerInstance->Exit(EXIT_STATUS_MODULE);
                }
        }