summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-19 20:12:22 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-19 20:12:22 +0000
commitbe10eab6ce68d4f06cc7b14bc2fca35e005ce6b5 (patch)
treec22583006f80a8cb86bb15489c196832476cd28a /src/modules.cpp
parentaa7cc18468f4b16bf79cd1788cad0cbf0d926817 (diff)
Maintain refcount of Module objects to complain about leaked pointers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11925 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 87d25ac42..856addbf5 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -51,12 +51,16 @@ void Event::Send()
// These declarations define the behavours of the base class Module (which does nothing at all)
-Module::Module() { }
+Module::Module() : refcount(0) { }
CullResult Module::cull()
{
return classbase::cull();
}
-Module::~Module() { }
+Module::~Module()
+{
+ if (refcount)
+ ServerInstance->Logs->Log("MODULE", DEFAULT, "References remain to destructed module " + ModuleSourceFile);
+}
ModResult Module::OnSendSnotice(char &snomask, std::string &type, const std::string &message) { return MOD_RES_PASSTHRU; }
void Module::OnUserConnect(User*) { }