From 1ff199172d2fd4fa8e7f29dbffd10c684e25e3a9 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 7 Aug 2006 20:12:24 +0000 Subject: Added some hax :( to prevent invalid symbols. It seems that instead of returning NULL, its setting a pointer to -1 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4770 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/inspircd.cpp') 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; } } -- cgit v1.2.3