From 233402b05c036aeb396af6ee27bf43f7405adb97 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 7 Aug 2006 20:42:18 +0000 Subject: The segfaults on missing init_module symbol are now gone, and hopefully not coming back! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4772 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/dynamic.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include/dynamic.h') diff --git a/include/dynamic.h b/include/dynamic.h index 937005e11..a8b7392bf 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -22,6 +22,8 @@ typedef void * (initfunc) (void); #include "inspircd_config.h" +extern void do_log(int, const char*, ...); + class DLLManager { public: @@ -61,21 +63,21 @@ class DLLFactoryBase : public DLLManager #endif }; - template class DLLFactory : public DLLFactoryBase { public: DLLFactory(const char *fname, const char *func_name=0) : DLLFactoryBase(fname,func_name) { if (factory_func) - factory = (T*)factory_func(); + factory = reinterpret_cast(factory_func()); else - factory = 0; + factory = reinterpret_cast(-1); } ~DLLFactory() { - delete factory; + if (factory) + delete factory; } T *factory; -- cgit v1.2.3