summaryrefslogtreecommitdiff
path: root/src/nickalias.cpp
diff options
context:
space:
mode:
authorAdam <Adam@Anope.org>2010-05-24 23:36:40 -0500
committerAdam <Adam@anope.org>2010-06-18 21:04:05 -0400
commit2fba686904e6f78ebab35df171c5757afeebf05d (patch)
tree523782bccc479606206f271cd6708b2f70fe8278 /src/nickalias.cpp
parent3a2c2a916a26f4fa1844e71a9f1c2fc25337fd2b (diff)
Burned slist, rewrote operservs XLine code
Diffstat (limited to 'src/nickalias.cpp')
-rw-r--r--src/nickalias.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nickalias.cpp b/src/nickalias.cpp
index 95d5bc4e9..a196145b9 100644
--- a/src/nickalias.cpp
+++ b/src/nickalias.cpp
@@ -42,7 +42,7 @@ NickAlias::NickAlias(const std::string &nickname, NickCore *nickcore)
this->nick = sstrdup(nickname.c_str());
this->nc = nickcore;
- slist_add(&nc->aliases, this);
+ nc->aliases.push_back(this);
NickAliasList[this->nick] = this;
@@ -88,8 +88,12 @@ NickAlias::~NickAlias()
if (this->nc)
{
/* Next: see if our core is still useful. */
- slist_remove(&this->nc->aliases, this);
- if (this->nc->aliases.count == 0)
+ std::list<NickAlias *>::iterator it = std::find(this->nc->aliases.begin(), this->nc->aliases.end(), this);
+ if (it != this->nc->aliases.end())
+ {
+ nc->aliases.erase(it);
+ }
+ if (this->nc->aliases.empty())
{
delete this->nc;
this->nc = NULL;