diff options
| author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-12-20 18:39:52 +0000 |
|---|---|---|
| committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-12-20 18:39:52 +0000 |
| commit | 7a7f1f8390f68f84350de63ff330184999264fcc (patch) | |
| tree | 3990cde97ba0cd53db38114de9e4412b24930dd6 /src/protocol/inspircd11.c | |
| parent | 861fe9e7b32c8e1e523cc774547e460c9ed67289 (diff) | |
Rewrote part of extensible, it will now automatically unallocate memory for us so we don't have to manually delete it everywhere anymore
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2711 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol/inspircd11.c')
| -rw-r--r-- | src/protocol/inspircd11.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 1eb6ba56e..cdeb58797 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -350,20 +350,15 @@ class InspIRCdProto : public IRCDProto void SetAutoIdentificationToken(User *u) { - char svidbuf[15], *c; + char svidbuf[15]; if (!u->nc) return; snprintf(svidbuf, sizeof(svidbuf), "%ld", static_cast<long>(u->timestamp)); - if (u->nc->GetExt("authenticationtoken", c)) - { - delete [] c; - u->nc->Shrink("authenticationtoken"); - } - - u->nc->Extend("authenticationtoken", sstrdup(svidbuf)); + u->nc->Shrink("authenticationtoken"); + u->nc->Extend("authenticationtoken", new ExtensibleItemPointerArray<char>(sstrdup(svidbuf))); } } ircd_proto; @@ -1050,19 +1045,6 @@ class ProtoInspIRCd : public Module pmodule_ircd_proto(&ircd_proto); moduleAddIRCDMsgs(); - - ModuleManager::Attach(I_OnDelCore, this); - } - - void OnDelCore(NickCore *nc) - { - char *c; - - if (nc->GetExt("authenticationtoken", c)) - { - delete [] c; - nc->Shrink("authenticationtoken"); - } } }; |
