diff options
| author | 2010-08-03 17:44:28 -0400 | |
|---|---|---|
| committer | 2010-08-03 17:44:28 -0400 | |
| commit | 4e23b5ff6e8005d77f415038beb9c8e6ebe283cc (patch) | |
| tree | 9f6f1bb9da0aaadad36f16a42b666ceaa7a2b9e7 /src/modmanager_static.cpp | |
| parent | Fix for crash on restart or config file open (bug #44) (diff) | |
| download | inspircd++-4e23b5ff6e8005d77f415038beb9c8e6ebe283cc.tar.gz inspircd++-4e23b5ff6e8005d77f415038beb9c8e6ebe283cc.tar.bz2 inspircd++-4e23b5ff6e8005d77f415038beb9c8e6ebe283cc.zip | |
Fix compilation, add sorted ->init() calls to modmanager_static
Diffstat (limited to 'src/modmanager_static.cpp')
| -rw-r--r-- | src/modmanager_static.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/modmanager_static.cpp b/src/modmanager_static.cpp index aa48b2d0a..9c5457cd9 100644 --- a/src/modmanager_static.cpp +++ b/src/modmanager_static.cpp @@ -184,22 +184,6 @@ void ModuleManager::LoadAll() } } - for(std::map<std::string, Module*>::iterator i = Modules.begin(); i != Modules.end(); i++) - { - Module* mod = i->second; - try - { - mod->init(); - } - catch (CoreException& modexcept) - { - LastModuleError = "Unable to initialize " + mod->ModuleSourceFile + ": " + modexcept.GetReason(); - ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError); - printf_c("\n[\033[1;31m*\033[0m] %s\n\n", LastModuleError.c_str()); - ServerInstance->Exit(EXIT_STATUS_MODULE); - } - } - /* We give every module a chance to re-prioritize when we introduce a new one, * not just the one thats loading, as the new module could affect the preference * of others @@ -218,6 +202,25 @@ void ModuleManager::LoadAll() ServerInstance->Exit(EXIT_STATUS_MODULE); } } + + IntModuleList& initlist = EventHandlers[I_ModuleInit]; + for(size_t i=0; i < initlist.size(); i++) + { + Module* mod = initlist[i]; + try + { + ServerInstance->Logs->Log("MODULE", DEBUG, "Initializing %s", mod->ModuleSourceFile.c_str()); + mod->init(); + } + catch (CoreException& modexcept) + { + LastModuleError = "Unable to initialize " + mod->ModuleSourceFile + ": " + modexcept.GetReason(); + ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError); + printf_c("\n[\033[1;31m*\033[0m] %s\n\n", LastModuleError.c_str()); + ServerInstance->Exit(EXIT_STATUS_MODULE); + } + } + initlist.clear(); } #endif |
