summaryrefslogtreecommitdiff
path: root/modules/extra/cs_set_misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/extra/cs_set_misc.cpp')
-rw-r--r--modules/extra/cs_set_misc.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/modules/extra/cs_set_misc.cpp b/modules/extra/cs_set_misc.cpp
index d287a24c1..48cd636e7 100644
--- a/modules/extra/cs_set_misc.cpp
+++ b/modules/extra/cs_set_misc.cpp
@@ -69,6 +69,7 @@ class CSSetMisc : public Module
Anope::string Name;
Anope::string Desc;
bool ShowHidden;
+ Command *c;
CommandInfo(const Anope::string &name, const Anope::string &desc, bool showhidden) : Name(name), Desc(desc), ShowHidden(showhidden) { }
};
@@ -89,10 +90,23 @@ class CSSetMisc : public Module
for (std::map<Anope::string, CommandInfo *>::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it)
{
if (set)
- set->DelSubcommand(it->first);
+ {
+ Command *c = set->FindSubcommand(it->second->Name);
+ if (c)
+ {
+ set->DelSubcommand(c);
+ delete c;
+ }
+ }
if (saset)
- saset->DelSubcommand(it->first);
- delete it->second;
+ {
+ Command *c = saset->FindSubcommand(it->second->Name);
+ if (c)
+ {
+ saset->DelSubcommand(c);
+ delete c;
+ }
+ }
}
this->Commands.clear();