diff options
author | Adam <Adam@anope.org> | 2013-02-14 20:58:01 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-02-14 20:58:01 -0500 |
commit | fc1d7ea89b5beed96022499fe7fa86bef7cf2aad (patch) | |
tree | 0208b9f5e153191742d15c51d6ca98737d8f7eb9 /modules | |
parent | 391f2822c8f6da7d6ffa8114817a8baf2aa265d5 (diff) |
Switch Destroy methods to delete
Diffstat (limited to 'modules')
25 files changed, 40 insertions, 40 deletions
diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index f46d61ef9..dd6da27d6 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -242,7 +242,7 @@ class CommandBSBot : public Command Log(LOG_ADMIN, source, this) << "DEL " << bi->nick; source.Reply(_("Bot \002%s\002 has been deleted."), nick.c_str()); - bi->Destroy(); + delete bi; return; } public: diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 28e5fbf7b..239c344ab 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -286,7 +286,7 @@ class CommandCSAccess : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << access->mask; FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, access)); - access->Destroy(); + delete access; } return; } diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index 94e7c424f..9a33a6fab 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -59,7 +59,7 @@ public: if (what.empty()) { - target_ci->Destroy(); + delete target_ci; target_ci = new ChannelInfo(*ci); target_ci->name = target; (*RegisteredChannelList)[target_ci->name] = target_ci; diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index b51add79c..884544211 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -57,7 +57,7 @@ class CommandCSDrop : public Command FOREACH_MOD(I_OnChanDrop, OnChanDrop(ci)); Channel *c = ci->c; - ci->Destroy(); + delete ci; source.Reply(_("Channel \002%s\002 has been dropped."), chan.c_str()); diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 3d5ca6655..6c39016ef 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -161,7 +161,7 @@ class CommandEntryMessage : public Command unsigned i = convertTo<unsigned>(message); if (i > 0 && i <= (*messages)->size()) { - (*messages)->at(i - 1)->Destroy(); + delete (*messages)->at(i - 1); (*messages)->erase((*messages)->begin() + i - 1); if ((*messages)->empty()) ci->Shrink("cs_entrymsg"); @@ -184,7 +184,7 @@ class CommandEntryMessage : public Command if (messages != NULL) { for (unsigned i = 0; i < (*messages)->size(); ++i) - (*messages)->at(i)->Destroy(); + delete (*messages)->at(i); (*messages)->clear(); ci->Shrink("cs_entrymsg"); } diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 6eb8c7721..4681c3d61 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -180,7 +180,7 @@ class CommandCSFlags : public Command if (current != NULL) { FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, current)); - current->Destroy(); + delete current; Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << mask; source.Reply(_("\002%s\002 removed from the %s access list."), mask.c_str(), ci->name.c_str()); } @@ -203,7 +203,7 @@ class CommandCSFlags : public Command access->flags = current_flags; if (current != NULL) - current->Destroy(); + delete current; ci->AddAccess(access); diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 222e8910c..41d8229f6 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -117,7 +117,7 @@ public: { if (log->extra == extra) { - log->Destroy(); + delete log; ci->log_settings->erase(ci->log_settings->begin() + i - 1); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to remove logging for " << command << " with method " << method << (extra == "" ? "" : " ") << extra; source.Reply(_("Logging for command %s on %s with log method %s%s%s has been removed."), command_name.c_str(), bi->nick.c_str(), method.c_str(), extra.empty() ? "" : " ", extra.empty() ? "" : extra.c_str()); diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index 95194a3e7..b7c821078 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -152,7 +152,7 @@ class CommandOSSeen : public Command if (time < buf->second->last) { Log(LOG_DEBUG) << buf->first << " was last seen " << Anope::strftime(buf->second->last) << ", deleting entry"; - buf->second->Destroy(); + delete buf->second; database.erase(buf); counter++; } @@ -309,7 +309,7 @@ class DataBasePurger : public CallBack if ((Anope::CurTime - cur->second->last) > purgetime) { Log(LOG_DEBUG) << cur->first << " was last seen " << Anope::strftime(cur->second->last) << ", purging entries"; - cur->second->Destroy(); + delete cur->second; database.erase(cur); } } diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index d0ad0a049..546175e14 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -411,7 +411,7 @@ class XOPBase : public Command source.Reply(_("\002%s\002 deleted from %s %s list."), a->mask.c_str(), ci->name.c_str(), source.command.c_str()); FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, a)); - a->Destroy(); + delete a; return; } diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index c7ebedd48..33175d023 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -114,7 +114,7 @@ class CommandMSDel : public Command FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(i))); else FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.nc, mi, mi->GetMemo(i))); - mi->GetMemo(i)->Destroy(); + delete mi->GetMemo(i); } mi->memos->clear(); if (!chan.empty()) diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 11eaecd84..605fd12c1 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -161,7 +161,7 @@ class CommandNSAJoin : public Command source.Reply(_("%s was not found on %s's auto join list."), chan.c_str(), nc->display.c_str()); else { - (*channels)->at(i)->Destroy(); + delete (*channels)->at(i); (*channels)->erase((*channels)->begin() + i); source.Reply(_("%s was removed from %s's auto join list."), chan.c_str(), nc->display.c_str()); } diff --git a/modules/commands/ns_drop.cpp b/modules/commands/ns_drop.cpp index 310efa1b2..a94feefdb 100644 --- a/modules/commands/ns_drop.cpp +++ b/modules/commands/ns_drop.cpp @@ -55,7 +55,7 @@ class CommandNSDrop : public Command FOREACH_MOD(I_OnNickDrop, OnNickDrop(source, na)); Log(!is_mine ? LOG_OVERRIDE : LOG_COMMAND, source, this) << "to drop nickname " << na->nick << " (group: " << na->nc->display << ") (email: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")"; - na->Destroy(); + delete na; if (!is_mine) { diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 1b21887a6..b8191046a 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -34,7 +34,7 @@ class NSGroupRequest : public IdentifyRequest if (na) { FOREACH_MOD(I_OnChangeCoreDisplay, OnChangeCoreDisplay(na->nc, u->nick)); - na->Destroy(); + delete na; } na = new NickAlias(nick, target->nc); diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index 96734c059..bdf609b03 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -172,7 +172,7 @@ class CommandOSAKill : public Command { source.Reply(USERHOST_MASK_TOO_WIDE, mask.c_str()); Log(LOG_ADMIN, source, this) << "tried to akill " << percent << "% of the network (" << affected << " users)"; - x->Destroy(); + delete x; return; } @@ -180,7 +180,7 @@ class CommandOSAKill : public Command FOREACH_RESULT(I_OnAddXLine, OnAddXLine(source, x, akills)); if (MOD_RESULT == EVENT_STOP) { - x->Destroy(); + delete x; return; } diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index 42d6193b9..52a6995fc 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -312,7 +312,7 @@ class CommandOSDNS : public Command } source.Reply(_("Zone %s removed."), z->name.c_str()); - z->Destroy(); + delete z; } void AddServer(CommandSource &source, const std::vector<Anope::string> ¶ms) @@ -370,7 +370,7 @@ class CommandOSDNS : public Command if (!z) { source.Reply(_("Zone %s does not exist."), zone.c_str()); - s->Destroy(); + delete s; return; } @@ -426,7 +426,7 @@ class CommandOSDNS : public Command Log(LOG_ADMIN, source, this) << "to delete server " << s->GetName(); source.Reply(_("Removed server %s."), s->GetName().c_str()); - s->Destroy(); + delete s; } void AddIP(CommandSource &source, const std::vector<Anope::string> ¶ms) diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index a50b8d802..e3a0c42b8 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -31,7 +31,7 @@ class MyForbidService : public ForbidService std::vector<ForbidData *>::iterator it = std::find(this->forbid_data->begin(), this->forbid_data->end(), d); if (it != this->forbid_data->end()) this->forbid_data->erase(it); - d->Destroy(); + delete d; } ForbidData *FindForbid(const Anope::string &mask, ForbidType ftype) anope_override @@ -65,7 +65,7 @@ class MyForbidService : public ForbidService Log(LOG_NORMAL, "expire/forbid") << "Expiring forbid for " << d->mask << " type " << ftype; this->forbid_data->erase(this->forbid_data->begin() + i - 1); - d->Destroy(); + delete d; } } diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index 283c302af..0833fbaa6 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -72,7 +72,7 @@ class MyNewsService : public NewsService { for (unsigned i = 0; i < 3; ++i) for (unsigned j = 0; j < newsItems[i].size(); ++j) - newsItems[i][j]->Destroy(); + delete newsItems[i][j]; } void AddNewsItem(NewsItem *n) @@ -86,7 +86,7 @@ class MyNewsService : public NewsService std::vector<NewsItem *>::iterator it = std::find(list.begin(), list.end(), n); if (it != list.end()) list.erase(it); - n->Destroy(); + delete n; } std::vector<NewsItem *> &GetNewsList(NewsType t) diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index 5a4cf279d..949aabbe8 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -103,7 +103,7 @@ class ExpireTimer : public Timer continue; Log(OperServ, "expire/exception") << "Session exception for " << e->mask << "has expired."; session_service->DelException(e); - e->Destroy(); + delete e; } } }; @@ -144,7 +144,7 @@ class ExceptionDelCallback : public NumberList FOREACH_MOD(I_OnExceptionDel, OnExceptionDel(source, e)); session_service->DelException(e); - e->Destroy(); + delete e; } }; @@ -352,7 +352,7 @@ class CommandOSException : public Command EventReturn MOD_RESULT; FOREACH_RESULT(I_OnExceptionAdd, OnExceptionAdd(exception)); if (MOD_RESULT == EVENT_STOP) - exception->Destroy(); + delete exception; else { session_service->AddException(exception); diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 75a31c7df..af397226a 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -366,7 +366,7 @@ class CommandOSSNLine : public CommandOSSXLineBase { source.Reply(USERHOST_MASK_TOO_WIDE, mask.c_str()); Log(LOG_ADMIN, source, this) << "tried to " << source.command << " " << percent << "% of the network (" << affected << " users)"; - x->Destroy(); + delete x; return; } @@ -374,7 +374,7 @@ class CommandOSSNLine : public CommandOSSXLineBase FOREACH_RESULT(I_OnAddXLine, OnAddXLine(source, x, this->xlm())); if (MOD_RESULT == EVENT_STOP) { - x->Destroy(); + delete x; return; } @@ -571,7 +571,7 @@ class CommandOSSQLine : public CommandOSSXLineBase { source.Reply(USERHOST_MASK_TOO_WIDE, mask.c_str()); Log(LOG_ADMIN, source, this) << "tried to SQLine " << percent << "% of the network (" << affected << " users)"; - x->Destroy(); + delete x; return; } @@ -579,7 +579,7 @@ class CommandOSSQLine : public CommandOSSXLineBase FOREACH_RESULT(I_OnAddXLine, OnAddXLine(source, x, this->xlm())); if (MOD_RESULT == EVENT_STOP) { - x->Destroy(); + delete x; return; } diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index ae37a7a9b..d50653912 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -195,7 +195,7 @@ class DBMySQL : public Module, public Pipe clear_null = true; std::map<unsigned int, Serializable *>::iterator it = obj->objects.find(id); if (it != obj->objects.end()) - it->second->Destroy(); // This also removes this object from the map + delete it->second; // This also removes this object from the map } else { @@ -225,7 +225,7 @@ class DBMySQL : public Module, public Pipe else { delete data; - s->Destroy(); + delete s; } } } diff --git a/modules/extra/m_dnsbl.cpp b/modules/extra/m_dnsbl.cpp index c9940eaab..49d39d980 100644 --- a/modules/extra/m_dnsbl.cpp +++ b/modules/extra/m_dnsbl.cpp @@ -75,7 +75,7 @@ class DNSBLResolver : public Request else { IRCD->SendAkill(NULL, x); - x->Destroy(); + delete x; } } }; diff --git a/modules/extra/m_proxyscan.cpp b/modules/extra/m_proxyscan.cpp index b43954299..feac20969 100644 --- a/modules/extra/m_proxyscan.cpp +++ b/modules/extra/m_proxyscan.cpp @@ -98,7 +98,7 @@ class ProxyConnect : public ConnectionSocket IRCD->SendSZLine(NULL, x); else IRCD->SendAkill(NULL, x); - x->Destroy(); + delete x; } } }; diff --git a/modules/extra/webcpanel/pages/chanserv/access.cpp b/modules/extra/webcpanel/pages/chanserv/access.cpp index 235a49d1c..33250035e 100644 --- a/modules/extra/webcpanel/pages/chanserv/access.cpp +++ b/modules/extra/webcpanel/pages/chanserv/access.cpp @@ -70,7 +70,7 @@ bool WebCPanel::ChanServ::Access::OnRequest(HTTPProvider *server, const Anope::s denied = true; } else - acc->Destroy(); + delete acc; break; } } diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 579c0b391..9832c622e 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -56,7 +56,7 @@ class ExpireCallback : public CallBack Log(LOG_NORMAL, "chanserv/expire") << "Expiring " << extra << "channel " << ci->name << " (founder: " << (ci->GetFounder() ? ci->GetFounder()->display : "(none)") << ")"; FOREACH_MOD(I_OnChanExpire, OnChanExpire(ci)); - ci->Destroy(); + delete ci; } } } @@ -142,7 +142,7 @@ class ChanServCore : public Module { Log(LOG_NORMAL, "chanserv/expire") << "Deleting channel " << ci->name << " owned by deleted nick " << nc->display; - ci->Destroy(); + delete ci; continue; } } diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 55f8b07cd..7b1ccd80c 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -177,7 +177,7 @@ class ExpireCallback : public CallBack extra = "suspended "; Log(LOG_NORMAL, "expire") << "Expiring " << extra << "nickname " << na->nick << " (group: " << na->nc->display << ") (e-mail: " << (na->nc->email.empty() ? "none" : na->nc->email) << ")"; FOREACH_MOD(I_OnNickExpire, OnNickExpire(na)); - na->Destroy(); + delete na; } } } |