diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-11 19:40:53 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-11 19:40:53 +0000 |
commit | a0b4b19b004f374d54c224a61ca27f779d54b981 (patch) | |
tree | 861988480c57efae247ea0bda7e040b1cb4b141d /src | |
parent | 44cf93876fdbbe412ec81bad8f702dd6678eab66 (diff) |
More module fixes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1051 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index a432c6181..4d02529cc 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -3537,15 +3537,15 @@ bool LoadModule(const char* filename) MODCOUNT--; return false; } + bool mextended = false; + while (modules.size() <= MODCOUNT+1) + { + modules.push_back(NULL); + log(DEFAULT,"Extending modules[]"); + bool mextended = true; + } if (factory[MODCOUNT+1]->factory) { - bool mextended = false; - while (modules.size() <= MODCOUNT+1) - { - modules.push_back(NULL); - log(DEFAULT,"Extending modules[]"); - bool mextended = true; - } Module* m = factory[MODCOUNT+1]->factory->CreateModule(); modules[MODCOUNT+1] = m; /* save the module and the module's classfactory, if @@ -3560,6 +3560,10 @@ bool LoadModule(const char* filename) { log(DEFAULT,"Unable to load %s",modfile); snprintf(MODERR,MAXBUF,"Factory function failed!"); + if (extended) + factory.erase(factory.end()); + if (mextended) + modules.erase(modules.end()); return false; } } |