X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fbase.cpp;h=dc57a8434c8c82c157f933d15699ad4dcea05dc8;hb=adb26a4e882d317de4e4135f414b7002cafe07a4;hp=211dc201508d4de41c73275522dcbf2ef9b594be;hpb=e244cb2c63b1ac1d85bdbb4691f7b1bd940ae804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/base.cpp b/src/base.cpp index 211dc2015..dc57a8434 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -174,20 +174,15 @@ void Extensible::doUnhookExtensions(const std::vector > } } -static struct DummyExtensionItem : LocalExtItem -{ - DummyExtensionItem() : LocalExtItem("", NULL) {} - void free(void*) {} -} dummy; - Extensible::Extensible() + : culled(false) { - extensions[&dummy] = NULL; } CullResult Extensible::cull() { FreeAllExtItems(); + culled = true; return classbase::cull(); } @@ -202,7 +197,7 @@ void Extensible::FreeAllExtItems() Extensible::~Extensible() { - if (!extensions.empty() && ServerInstance && ServerInstance->Logs) + if ((!extensions.empty() || !culled) && ServerInstance && ServerInstance->Logs) ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "Extensible destructor called without cull @%p", (void*)this); } @@ -316,4 +311,3 @@ ModuleException::ModuleException(const std::string &message, Module* who) : CoreException(message, who ? who->ModuleSourceFile : "A Module") { } -