summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-11 18:51:08 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-11 18:51:08 +0000
commit70e7450ebf0ce0fc4670fda0f18599268cd67273 (patch)
tree290f8f5f9f2a9a656f0ffb77670c0f50a6d04afd
parentbf9f5acb8d00fbac49c893283cd1ce549934e38d (diff)
Attempts to fix broken /loadmodule on some linux
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1047 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspircd.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index d1e6af874..ea3feb304 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -3519,20 +3519,39 @@ bool LoadModule(const char* filename)
return false;
}
}
+ bool extended = false;
+ if (factory.size() < MODCOUNT+1)
+ {
+ factory.push_back(NULL); // make an empty space
+ bool extended = true;
+ }
+
factory[MODCOUNT+1] = new ircd_module(modfile);
if (factory[MODCOUNT+1]->LastError())
{
log(DEFAULT,"Unable to load %s: %s",modfile,factory[MODCOUNT+1]->LastError());
snprintf(MODERR,MAXBUF,"Loader/Linker error: %s",factory[MODCOUNT+1]->LastError());
+ if (extended)
+ factory.erase(factory.end());
MODCOUNT--;
return false;
}
if (factory[MODCOUNT+1]->factory)
{
+ bool mextended = false;
+ if (modules.size() < MODCOUNT+1)
+ {
+ modules.push_back(NULL);
+ bool extended = true;
+ }
modules[MODCOUNT+1] = factory[MODCOUNT+1]->factory->CreateModule();
/* save the module and the module's classfactory, if
* this isnt done, random crashes can occur :/ */
module_names.push_back(filename);
+ if (extended)
+ factory.erase(factory.end());
+ if (mextended)
+ modules.erase(modules.end());
}
else
{