diff options
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 3ce2261c5..79435ea58 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -586,18 +586,21 @@ bool InspIRCd::LoadModule(const char* filename) return false; } } - ircd_module* a = new ircd_module(modfile); - factory[MODCOUNT+1] = a; - 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()); - return false; - } try { - if (factory[MODCOUNT+1]->factory) + ircd_module* a = new ircd_module(modfile); + log(DEBUG,"ircd_module constructor success, MODCOUNT %d",MODCOUNT); + factory[MODCOUNT+1] = a; + 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()); + return false; + } + log(DEBUG,"No last error"); + if ((int)factory[MODCOUNT+1]->factory != -1) { + log(DEBUG,"Factory ptr: %0x",&factory[MODCOUNT+1]->factory); Module* m = factory[MODCOUNT+1]->factory->CreateModule(MyServer); modules[MODCOUNT+1] = m; /* save the module and the module's classfactory, if @@ -616,7 +619,7 @@ bool InspIRCd::LoadModule(const char* filename) else { log(DEFAULT,"Unable to load %s",modfile); - snprintf(MODERR,MAXBUF,"Factory function failed!"); + snprintf(MODERR,MAXBUF,"Factory function failed: Probably missing init_module() entrypoint."); return false; } } |