diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-07-09 15:00:31 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-07-09 15:00:31 +0200 |
commit | 3a67168036e1d8e0406c66c3ccf37812228a9524 (patch) | |
tree | 2e891624fb5eeca40fd546e6fb32c5ca286cf7c4 /src | |
parent | 93786820aad505e00d5c1c07228ef7aa6c3f22b8 (diff) |
core_whowas Delete elements of the per nick deque in the destructor of WhoWas::Nick
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_whowas.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp index 801f1186e..0a418df3e 100644 --- a/src/coremods/core_whowas.cpp +++ b/src/coremods/core_whowas.cpp @@ -118,8 +118,6 @@ void CommandWhowas::AddToWhoWas(User* user) if (it != whowas.end()) { WhoWas::Nick* set = it->second; - stdalgo::delete_all(set->entries); - delete set; whowas.erase(it); } @@ -162,8 +160,6 @@ void CommandWhowas::Prune() } WhoWas::Nick* nick = iter->second; - stdalgo::delete_all(nick->entries); - delete nick; whowas.erase(iter); whowas_fifo.pop_front(); @@ -204,10 +200,6 @@ CommandWhowas::~CommandWhowas() for (whowas_users::iterator i = whowas.begin(); i != whowas.end(); ++i) { WhoWas::Nick* nick = i->second; - whowas_set* set = &nick->entries; - for (whowas_set::iterator j = set->begin(); j != set->end(); ++j) - delete *j; - delete nick; } } @@ -217,6 +209,11 @@ WhoWasGroup::WhoWasGroup(User* user) : host(user->host), dhost(user->dhost), ide { } +WhoWas::Nick::~Nick() +{ + stdalgo::delete_all(entries); +} + class ModuleWhoWas : public Module { CommandWhowas cmd; |