From e50d016aa23083f81dcf181f68edb81c5b23c78d Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 18 Oct 2009 02:57:46 +0000 Subject: Cull channels, warn when Extensible objects are not culled as they must be git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11901 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/base.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/base.cpp') diff --git a/src/base.cpp b/src/base.cpp index 15a642eb4..977227440 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -136,17 +136,27 @@ void Extensible::doUnhookExtensions(const std::vector& toRemove) } } +Extensible::Extensible() +{ + extensions[NULL] = NULL; +} + CullResult Extensible::cull() { for(ExtensibleStore::iterator i = extensions.begin(); i != extensions.end(); ++i) { - i->first->free(i->second); + if (i->first) + i->first->free(i->second); } + extensions.clear(); return classbase::cull(); } Extensible::~Extensible() { + if (!extensions.empty() && ServerInstance && ServerInstance->Logs) + ServerInstance->Logs->Log("CULLLIST", DEBUG, + "Extensible destructor called without cull @%p", (void*)this); } LocalExtItem::LocalExtItem(const std::string& Key, Module* mod) : ExtensionItem(Key, mod) -- cgit v1.3.1-10-gc9f91