summaryrefslogtreecommitdiff
path: root/modules/commands/ms_del.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/ms_del.cpp')
-rw-r--r--modules/commands/ms_del.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp
index 8876f1d31..a3ac928a7 100644
--- a/modules/commands/ms_del.cpp
+++ b/modules/commands/ms_del.cpp
@@ -100,12 +100,11 @@ class CommandMSDel : public Command
else
{
/* Delete all memos. */
- for (unsigned i = 0, end = mi->memos->size(); i < end; ++i)
+ for (unsigned i = mi->memos->size(); i > 0; --i)
{
FOREACH_MOD(OnMemoDel, (ci ? ci->name : source.nc->display, mi, mi->GetMemo(i)));
- delete mi->GetMemo(i);
+ mi->Del(i - 1);
}
- mi->memos->clear();
if (!chan.empty())
source.Reply(_("All memos for channel %s have been deleted."), chan.c_str());
else