git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1047
e03df62e-2008-0410-955e-
edbf42e46eb7
+ 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());
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)
{
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);
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());