From 3dc81ee1331d1b37ee85be9bf0d843e3b6827a2d Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 30 Sep 2009 21:55:21 +0000 Subject: Add explicit reference-counting base class git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11785 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 21bfce3db..86d0b3c5e 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -727,11 +727,6 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) Classes[i] = me; } } - - for(ClassMap::iterator toRemove = oldBlocksByMask.begin(); toRemove != oldBlocksByMask.end(); toRemove++) - { - removed_classes.push_back(toRemove->second); - } } @@ -1143,9 +1138,6 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) // write once here, to try it out and make sure its ok ServerInstance->WritePID(this->PID); - FailedPortList pl; - ServerInstance->BindPorts(pl); - /* * These values can only be set on boot. Keep their old values. Do it before we send messages so we actually have a servername. */ @@ -1153,18 +1145,23 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) { memcpy(this->ServerName, old->ServerName, sizeof(this->ServerName)); memcpy(this->sid, old->sid, sizeof(this->sid)); - } - - if (pl.size()) - { - errstr << "Not all your client ports could be bound.\nThe following port(s) failed to bind:\n"; + this->argv = old->argv; + this->argc = old->argc; - int j = 1; - for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++) + // Same for ports... they're bound later on first run. + FailedPortList pl; + ServerInstance->BindPorts(pl); + if (pl.size()) { - char buf[MAXBUF]; - snprintf(buf, MAXBUF, "%d. Address: %s Reason: %s\n", j, i->first.empty() ? "" : i->first.c_str(), i->second.c_str()); - errstr << buf; + errstr << "Not all your client ports could be bound.\nThe following port(s) failed to bind:\n"; + + int j = 1; + for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++) + { + char buf[MAXBUF]; + snprintf(buf, MAXBUF, "%d. Address: %s Reason: %s\n", j, i->first.empty() ? "" : i->first.c_str(), i->second.c_str()); + errstr << buf; + } } } @@ -1212,12 +1209,6 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) return; ApplyModules(user); - for (std::vector::iterator i = removed_classes.begin(); i != removed_classes.end(); i++) - { - ConnectClass* c = *i; - if (0 == --c->RefCount) - delete c; - } } void ServerConfig::ApplyModules(User* user) -- cgit v1.2.3