From eabb9c0c11c3fdd51c57410f4b104bf08ca57d46 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 8 Jul 2013 20:35:04 -0400 Subject: Fix deleting badwords/modes/logs etc --- modules/commands/cs_mode.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'modules/commands/cs_mode.cpp') diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index f5c98d487..b0a2e2b91 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -42,6 +42,16 @@ struct ModeLocksImpl : ModeLocks { } + ~ModeLocksImpl() + { + for (ModeList::iterator it = this->mlocks->begin(); it != this->mlocks->end();) + { + ModeLock *ml = *it; + ++it; + delete ml; + } + } + bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const anope_override { if (!mode) @@ -818,13 +828,14 @@ class CSMode : public Module { CommandCSMode commandcsmode; CommandCSModes commandcsmodes; - ExtensibleItem modelocks; Serialize::Type modelocks_type; + ExtensibleItem modelocks; public: CSMode(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandcsmode(this), commandcsmodes(this), - modelocks(this, "modelocks"), modelocks_type("ModeLock", ModeLockImpl::Unserialize) + modelocks_type("ModeLock", ModeLockImpl::Unserialize), + modelocks(this, "modelocks") { } -- cgit