X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodmanager_dynamic.cpp;h=dab1143adc8567aaf103c2b1ba1c396d5ad7e100;hb=41c6a4d5efb21d94c8188b06ded74c92c5abe49c;hp=27da56c692ab32f9a779403563d02b7d9082b9b6;hpb=336e30f61f9cb04620f5be46189753636f4f9d49;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp index 27da56c69..dab1143ad 100644 --- a/src/modmanager_dynamic.cpp +++ b/src/modmanager_dynamic.cpp @@ -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::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); } }