summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9f108a4d9..453dba91b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -116,8 +116,6 @@ class UplinkSocket : public ClientSocket
~UplinkSocket()
{
- /* Process the last bits of data before disconnecting */
- SocketEngine->Process();
UplinkSock = NULL;
}
@@ -188,6 +186,7 @@ void do_restart_services()
UserListByUID.erase(it->second->GetUID());
}
ircdproto->SendSquit(Config.ServerName, quitmsg);
+ SocketEngine->Process();
delete UplinkSock;
close_log();
/* First don't unload protocol module, then do so */
@@ -236,6 +235,7 @@ static void services_shutdown()
while (!UserListByNick.empty())
delete UserListByNick.begin()->second;
}
+ SocketEngine->Process();
delete UplinkSock;
FOREACH_MOD(I_OnShutdown, OnShutdown());
/* First don't unload protocol module, then do so */
@@ -553,6 +553,18 @@ int main(int ac, char **av, char **envp)
delete u;
}
+ /* Nuke all channels */
+ for (channel_map::const_iterator it = ChannelList.begin(); it != ChannelList.end();)
+ {
+ Channel *c = it->second;
+ ++it;
+
+ delete c;
+ }
+
+ Me->SetFlag(SERVER_SYNCING);
+ Me->ClearLinks();
+
unsigned j = 0;
for (; j < (Config.MaxRetries ? Config.MaxRetries : j + 1); ++j)
{