diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-07 18:20:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-07 18:20:34 +0000 |
commit | f6f348468676e053037da8ebeebbef47351202b0 (patch) | |
tree | e00b4a792c470f1276c19a1a8115845a3c486f57 /src/inspircd.cpp | |
parent | ec7fc489a14af54738da17a94b162a9606df4756 (diff) |
/LOADMODULE and /UNLOADMODULE all successfully working!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1002 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 14 |
1 files changed, 13 insertions, 1 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); |