diff options
author | Adam <Adam@Anope.org> | 2010-05-24 23:36:40 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-18 21:04:05 -0400 |
commit | 2fba686904e6f78ebab35df171c5757afeebf05d (patch) | |
tree | 523782bccc479606206f271cd6708b2f70fe8278 /src/nickalias.cpp | |
parent | 3a2c2a916a26f4fa1844e71a9f1c2fc25337fd2b (diff) |
Burned slist, rewrote operservs XLine code
Diffstat (limited to 'src/nickalias.cpp')
-rw-r--r-- | src/nickalias.cpp | 10 |
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; |