diff --git a/zone/command.cpp b/zone/command.cpp index b8914e593..8d15f9960 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -52,6 +52,7 @@ int (*command_dispatch)(Client *,std::string) = command_notavail; std::map commandlist; std::map commandaliases; +std::vector command_delete_list; /* * command_notavail @@ -466,6 +467,9 @@ int command_init(void) */ void command_deinit(void) { + for (auto &c : command_delete_list) + delete c; + command_delete_list.clear(); commandlist.clear(); commandaliases.clear(); @@ -517,6 +521,7 @@ int command_add(std::string command_name, std::string description, uint8 admin, commandlist[command_name] = c; commandaliases[command_name] = command_name; + command_delete_list.push_back(c); command_count++; return 0;