summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-03-21 23:39:39 -0500
committerAdam <Adam@anope.org>2013-03-21 23:39:39 -0500
commitdcffa5da6fe7aad26860973af5651f7c59902343 (patch)
tree97634bfb9f950750613a0539f5ea5f3b7ee247ad /modules
parent221e79f50d59eff98a2c671332bf9d92dbe35dd5 (diff)
Properly cleanup after entrymsglists and ajoinlists when destructed
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/cs_entrymsg.cpp6
-rw-r--r--modules/commands/ns_ajoin.cpp7
2 files changed, 13 insertions, 0 deletions
diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp
index 46089cd94..68c36e7c7 100644
--- a/modules/commands/cs_entrymsg.cpp
+++ b/modules/commands/cs_entrymsg.cpp
@@ -44,6 +44,12 @@ static unsigned MaxEntries = 0;
struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> >, ExtensibleItem
{
EntryMessageList() : Serialize::Checker<std::vector<EntryMsg *> >("EntryMsg") { }
+
+ ~EntryMessageList()
+ {
+ for (unsigned i = 0; i < (*this)->size(); ++i)
+ delete (*this)->at(i);
+ }
};
Serializable* EntryMsg::Unserialize(Serializable *obj, Serialize::Data &data)
diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp
index 605fd12c1..3f4d9d3ec 100644
--- a/modules/commands/ns_ajoin.cpp
+++ b/modules/commands/ns_ajoin.cpp
@@ -18,6 +18,7 @@ struct AJoinEntry;
struct AJoinList : Serialize::Checker<std::vector<AJoinEntry *> >, ExtensibleItem
{
AJoinList() : Serialize::Checker<std::vector<AJoinEntry *> >("AJoinEntry") { }
+ ~AJoinList();
};
struct AJoinEntry : Serializable
@@ -75,6 +76,12 @@ struct AJoinEntry : Serializable
}
};
+AJoinList::~AJoinList()
+{
+ for (unsigned i = 0; i < (*this)->size(); ++i)
+ delete (*this)->at(i);
+}
+
class CommandNSAJoin : public Command
{
void DoList(CommandSource &source, NickCore *nc)