summaryrefslogtreecommitdiff
path: root/src/base.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/base.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/base.cpp')
-rw-r--r--src/base.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/base.cpp b/src/base.cpp
index 389f3915a..c0bc40811 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -270,3 +270,18 @@ void StringExtItem::free(void* item)
{
delete static_cast<std::string*>(item);
}
+
+ModuleException::ModuleException(const std::string &message, Module* who)
+ : CoreException(message, who ? who->ModuleSourceFile : "A Module")
+{
+}
+
+ModuleRef::ModuleRef(Module* v) : value(v)
+{
+ if (value) inc(value);
+}
+
+ModuleRef::~ModuleRef()
+{
+ if (value) dec(value);
+}