summaryrefslogtreecommitdiff
path: root/modules/commands/cs_mode.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-08 20:35:04 -0400
committerAdam <Adam@anope.org>2013-07-08 20:35:04 -0400
commiteabb9c0c11c3fdd51c57410f4b104bf08ca57d46 (patch)
tree0f9855c9ce3470c18b569efff2a5cf5ba02f4fa9 /modules/commands/cs_mode.cpp
parentb103d16eb1a9182715b808d913f964abd9f783be (diff)
Fix deleting badwords/modes/logs etc
Diffstat (limited to 'modules/commands/cs_mode.cpp')
-rw-r--r--modules/commands/cs_mode.cpp15
1 files changed, 13 insertions, 2 deletions
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 &param, bool status) const anope_override
{
if (!mode)
@@ -818,13 +828,14 @@ class CSMode : public Module
{
CommandCSMode commandcsmode;
CommandCSModes commandcsmodes;
- ExtensibleItem<ModeLocksImpl> modelocks;
Serialize::Type modelocks_type;
+ ExtensibleItem<ModeLocksImpl> 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")
{
}