1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 22:46:39 +02:00

Switch Destroy methods to delete

This commit is contained in:
Adam
2013-02-14 20:58:01 -05:00
parent 391f2822c8
commit fc1d7ea89b
32 changed files with 62 additions and 62 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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());
+2 -2
View File
@@ -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");
}
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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());
+2 -2
View File
@@ -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);
}
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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())
+1 -1
View File
@@ -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());
}
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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;
}
+3 -3
View File
@@ -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> &params)
@@ -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> &params)
+2 -2
View File
@@ -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;
}
}
+2 -2
View File
@@ -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)
+3 -3
View File
@@ -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);
+4 -4
View File
@@ -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;
}
+2 -2
View File
@@ -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;
}
}
}
+1 -1
View File
@@ -75,7 +75,7 @@ class DNSBLResolver : public Request
else
{
IRCD->SendAkill(NULL, x);
x->Destroy();
delete x;
}
}
};
+1 -1
View File
@@ -98,7 +98,7 @@ class ProxyConnect : public ConnectionSocket
IRCD->SendSZLine(NULL, x);
else
IRCD->SendAkill(NULL, x);
x->Destroy();
delete x;
}
}
};
@@ -70,7 +70,7 @@ bool WebCPanel::ChanServ::Access::OnRequest(HTTPProvider *server, const Anope::s
denied = true;
}
else
acc->Destroy();
delete acc;
break;
}
}
+2 -2
View File
@@ -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;
}
}
+1 -1
View File
@@ -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;
}
}
}