summaryrefslogtreecommitdiff
path: root/include/dynamic.h
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-07 20:42:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-07 20:42:18 +0000
commit233402b05c036aeb396af6ee27bf43f7405adb97 (patch)
tree61a4cddc05b8f814aa8bedd9436d0403d764ae31 /include/dynamic.h
parent7548a18e4c2fa474ec4bd370c483bd991fafaa00 (diff)
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
Diffstat (limited to 'include/dynamic.h')
-rw-r--r--include/dynamic.h10
1 files changed, 6 insertions, 4 deletions
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 T> 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<T*>(factory_func());
else
- factory = 0;
+ factory = reinterpret_cast<T*>(-1);
}
~DLLFactory()
{
- delete factory;
+ if (factory)
+ delete factory;
}
T *factory;