* ---------------------------------------------------
*/
-/* $Core */
-
#include "inspircd_config.h"
#include "base.h"
#include <time.h>
#include "inspircd.h"
+#include <typeinfo>
classbase::classbase()
{
+ if (ServerInstance && ServerInstance->Logs)
+ ServerInstance->Logs->Log("CULLLIST", DEBUG, "classbase::+%s @%p",
+ typeid(*this).name(), (void*)this);
}
CullResult classbase::cull()
{
+ if (ServerInstance && ServerInstance->Logs)
+ ServerInstance->Logs->Log("CULLLIST", DEBUG, "classbase::-%s @%p",
+ typeid(*this).name(), (void*)this);
return CullResult();
}
classbase::~classbase()
{
+ if (ServerInstance && ServerInstance->Logs)
+ ServerInstance->Logs->Log("CULLLIST", DEBUG, "classbase::~%s @%p",
+ typeid(*this).name(), (void*)this);
}
CullResult::CullResult()
}
}
+static struct DummyExtensionItem : LocalExtItem
+{
+ DummyExtensionItem() : LocalExtItem("", NULL) {}
+ void free(void*) {}
+} dummy;
+
+Extensible::Extensible()
+{
+ extensions[&dummy] = NULL;
+}
+
CullResult Extensible::cull()
{
for(ExtensibleStore::iterator i = extensions.begin(); i != extensions.end(); ++i)
{
- i->first->free(i->second);
+ 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)