diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 14 | ||||
-rw-r--r-- | src/modules.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_helpop.cpp | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index dd1be77d9..44b84979c 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -3269,7 +3269,7 @@ bool UnloadModule(const char* filename) { if (module_names[j] == std::string(filename)) { - if (factory[j]->factory->GetVersion().Flags & VF_STATIC) + if (modules[j]->GetVersion().Flags & VF_STATIC) { log(DEFAULT,"Failed to unload STATIC module %s",filename); snprintf(MODERR,MAXBUF,"Module not unloadable (marked static)"); @@ -3277,6 +3277,9 @@ bool UnloadModule(const char* filename) } // found the module log(DEBUG,"Deleting module..."); + delete modules[j]; + modules[j] = NULL; + log(DEBUG,"Deleting module factory pointer..."); delete factory[j]->factory; log(DEBUG,"Deleting module factory..."); delete factory[j]; @@ -3302,6 +3305,15 @@ bool UnloadModule(const char* filename) break; } } + log(DEBUG,"Erasing module pointer..."); + for (std::vector<Module*>::iterator m = modules.begin(); m!= modules.end(); m++) + { + if (*m == NULL) + { + modules.erase(m); + break; + } + } log(DEBUG,"Removing dependent commands..."); removecommands(filename); log(DEFAULT,"Module %s unloaded",filename); diff --git a/src/modules.cpp b/src/modules.cpp index 7242ae92e..f068dc591 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -315,7 +315,7 @@ void Module::OnRehash() { } void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { } int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; } int Module::OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) { return false; } -Version Module::GetVersion() { return Version(1,0,0,0); } +Version Module::GetVersion() { return Version(1,0,0,0,VF_VENDOR); } void Module::OnOper(userrec* user) { }; void Module::OnInfo(userrec* user) { }; void Module::OnWhois(userrec* source, userrec* dest) { }; diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 1798122b2..efe4f513d 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -201,7 +201,7 @@ class ModuleHelpop : public Module virtual Version GetVersion() { - return Version(0,0,0,1,VF_STATIC|VF_VENDOR); + return Version(1,0,0,1,VF_STATIC|VF_VENDOR); } }; |