summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/extensible.h10
-rw-r--r--src/base.cpp8
-rw-r--r--src/coremods/core_channel/invite.h4
-rw-r--r--src/modules/m_callerid.cpp4
-rw-r--r--src/modules/m_monitor.cpp4
-rw-r--r--src/modules/m_sslinfo.cpp2
-rw-r--r--src/modules/m_topiclock.cpp2
7 files changed, 17 insertions, 17 deletions
diff --git a/include/extensible.h b/include/extensible.h
index afb1cd5b6..f88ede461 100644
--- a/include/extensible.h
+++ b/include/extensible.h
@@ -65,7 +65,7 @@ class CoreExport ExtensionItem : public ServiceProvider, public usecountbase
*/
virtual void unserialize(SerializeFormat format, Extensible* container, const std::string& value) = 0;
/** Free the item */
- virtual void free(void* item) = 0;
+ virtual void free(Extensible* container, void* item) = 0;
/** Register this object in the ExtensionManager
*/
@@ -147,7 +147,7 @@ class CoreExport LocalExtItem : public ExtensionItem
virtual ~LocalExtItem();
std::string serialize(SerializeFormat format, const Extensible* container, void* item) const CXX11_OVERRIDE;
void unserialize(SerializeFormat format, Extensible* container, const std::string& value) CXX11_OVERRIDE;
- void free(void* item) CXX11_OVERRIDE = 0;
+ void free(Extensible* container, void* item) CXX11_OVERRIDE = 0;
};
template <typename T, typename Del = stdalgo::defaultdeleter<T> >
@@ -190,7 +190,7 @@ class SimpleExtItem : public LocalExtItem
del(old);
}
- void free(void* item) CXX11_OVERRIDE
+ void free(Extensible* container, void* item) CXX11_OVERRIDE
{
Del del;
del(static_cast<T*>(item));
@@ -216,7 +216,7 @@ class CoreExport LocalIntExt : public LocalExtItem
intptr_t get(const Extensible* container) const;
intptr_t set(Extensible* container, intptr_t value);
void unset(Extensible* container) { set(container, 0); }
- void free(void* item) CXX11_OVERRIDE;
+ void free(Extensible* container, void* item) CXX11_OVERRIDE;
};
class CoreExport StringExtItem : public ExtensionItem
@@ -229,5 +229,5 @@ class CoreExport StringExtItem : public ExtensionItem
void unserialize(SerializeFormat format, Extensible* container, const std::string& value) CXX11_OVERRIDE;
void set(Extensible* container, const std::string& value);
void unset(Extensible* container);
- void free(void* item) CXX11_OVERRIDE;
+ void free(Extensible* container, void* item) CXX11_OVERRIDE;
};
diff --git a/src/base.cpp b/src/base.cpp
index 0ff3fbe4c..f698bad2e 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -186,7 +186,7 @@ void Extensible::doUnhookExtensions(const std::vector<reference<ExtensionItem> >
ExtensibleStore::iterator e = extensions.find(item);
if (e != extensions.end())
{
- item->free(e->second);
+ item->free(this, e->second);
extensions.erase(e);
}
}
@@ -208,7 +208,7 @@ void Extensible::FreeAllExtItems()
{
for(ExtensibleStore::iterator i = extensions.begin(); i != extensions.end(); ++i)
{
- i->first->free(i->second);
+ i->first->free(this, i->second);
}
extensions.clear();
}
@@ -294,7 +294,7 @@ intptr_t LocalIntExt::set(Extensible* container, intptr_t value)
return reinterpret_cast<intptr_t>(unset_raw(container));
}
-void LocalIntExt::free(void*)
+void LocalIntExt::free(Extensible* container, void* item)
{
}
@@ -337,7 +337,7 @@ void StringExtItem::unset(Extensible* container)
delete static_cast<std::string*>(old);
}
-void StringExtItem::free(void* item)
+void StringExtItem::free(Extensible* container, void* item)
{
delete static_cast<std::string*>(item);
}
diff --git a/src/coremods/core_channel/invite.h b/src/coremods/core_channel/invite.h
index 2a99ec2df..19e3861f8 100644
--- a/src/coremods/core_channel/invite.h
+++ b/src/coremods/core_channel/invite.h
@@ -66,10 +66,10 @@ class Invite::ExtItem : public ExtensionItem
{
void* store = unset_raw(ext);
if (store)
- free(store);
+ free(ext, store);
}
- void free(void* item) CXX11_OVERRIDE
+ void free(Extensible* container, void* item) CXX11_OVERRIDE
{
Store<T>* store = static_cast<Store<T>*>(item);
for (typename Store<T>::List::iterator i = store->invites.begin(); i != store->invites.end(); )
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index b0ec3b8ff..f50bdeedf 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -91,7 +91,7 @@ struct CallerIDExtInfo : public ExtensionItem
void* old = get_raw(container);
if (old)
- this->free(old);
+ this->free(NULL, old);
callerid_data* dat = new callerid_data;
set_raw(container, dat);
@@ -125,7 +125,7 @@ struct CallerIDExtInfo : public ExtensionItem
return dat;
}
- void free(void* item) CXX11_OVERRIDE
+ void free(Extensible* container, void* item) CXX11_OVERRIDE
{
callerid_data* dat = static_cast<callerid_data*>(item);
diff --git a/src/modules/m_monitor.cpp b/src/modules/m_monitor.cpp
index 38e7ccc3e..fd72c7320 100644
--- a/src/modules/m_monitor.cpp
+++ b/src/modules/m_monitor.cpp
@@ -79,7 +79,7 @@ class IRCv3::Monitor::Manager
void unset(Extensible* container)
{
- free(unset_raw(container));
+ free(container, unset_raw(container));
}
std::string serialize(SerializeFormat format, const Extensible* container, void* item) const CXX11_OVERRIDE
@@ -101,7 +101,7 @@ class IRCv3::Monitor::Manager
void unserialize(SerializeFormat format, Extensible* container, const std::string& value) CXX11_OVERRIDE;
- void free(void* item) CXX11_OVERRIDE
+ void free(Extensible* container, void* item) CXX11_OVERRIDE
{
delete static_cast<ExtData*>(item);
}
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index 6f679a871..6d0a84249 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -79,7 +79,7 @@ class SSLCertExt : public ExtensionItem {
}
}
- void free(void* item) CXX11_OVERRIDE
+ void free(Extensible* container, void* item) CXX11_OVERRIDE
{
ssl_cert* old = static_cast<ssl_cert*>(item);
if (old && old->refcount_dec())
diff --git a/src/modules/m_topiclock.cpp b/src/modules/m_topiclock.cpp
index cbe524408..c65f27668 100644
--- a/src/modules/m_topiclock.cpp
+++ b/src/modules/m_topiclock.cpp
@@ -115,7 +115,7 @@ class FlagExtItem : public ExtensionItem
unset_raw(container);
}
- void free(void* item) CXX11_OVERRIDE
+ void free(Extensible* container, void* item) CXX11_OVERRIDE
{
// nothing to free
}