diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-02-10 13:56:14 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-02-10 13:56:14 +0100 |
commit | 6fb7507c5801ed0a5e819ccf5c37da396fa21283 (patch) | |
tree | e30f2f6cb7ee726a7898d52ff94744b6f6894ca9 /src | |
parent | 034488fc4aca4fb85c923d881f4b95675eba37b6 (diff) |
Replace DummyExtItem with a flag in Extensible
Diffstat (limited to 'src')
-rw-r--r-- | src/base.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/base.cpp b/src/base.cpp index cf28f8e7d..dc57a8434 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -174,20 +174,15 @@ void Extensible::doUnhookExtensions(const std::vector<reference<ExtensionItem> > } } -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); } |