From aa7cc18468f4b16bf79cd1788cad0cbf0d926817 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 19 Oct 2009 20:12:12 +0000 Subject: Fix implementation of reference to const, use reference counting for ExtensibleItem git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11924 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/base.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/base.cpp') diff --git a/src/base.cpp b/src/base.cpp index 2a89a4830..389f3915a 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -47,6 +47,9 @@ refcountbase::refcountbase() : refcount(0) refcountbase::~refcountbase() { + if (refcount && ServerInstance && ServerInstance->Logs) + ServerInstance->Logs->Log("CULLLIST", DEBUG, "refcountbase::~ @%p with refcount %d", + (void*)this, refcount); } ExtensionItem::ExtensionItem(const std::string& Key, Module* mod) : key(Key), owner(mod) @@ -97,12 +100,12 @@ void ExtensionManager::Register(ExtensionItem* item) types.insert(std::make_pair(item->key, item)); } -void ExtensionManager::BeginUnregister(Module* module, std::vector& list) +void ExtensionManager::BeginUnregister(Module* module, std::vector >& list) { - std::map::iterator i = types.begin(); + std::map >::iterator i = types.begin(); while (i != types.end()) { - std::map::iterator me = i++; + std::map >::iterator me = i++; ExtensionItem* item = me->second; if (item->owner == module) { @@ -114,15 +117,15 @@ void ExtensionManager::BeginUnregister(Module* module, std::vector::iterator i = types.find(name); + std::map >::iterator i = types.find(name); if (i == types.end()) return NULL; return i->second; } -void Extensible::doUnhookExtensions(const std::vector& toRemove) +void Extensible::doUnhookExtensions(const std::vector >& toRemove) { - for(std::vector::const_iterator i = toRemove.begin(); i != toRemove.end(); ++i) + for(std::vector >::const_iterator i = toRemove.begin(); i != toRemove.end(); ++i) { ExtensionItem* item = *i; ExtensibleStore::iterator e = extensions.find(item); -- cgit v1.2.3