From 84951d4b109ddfe6b68871516afa0e76d3b8e3af Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 12 Feb 2007 20:44:21 +0000 Subject: Change around the order of InspIRCd::Cleanup(), as per bug #212 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6580 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index ce8fc9521..354befcb3 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -86,6 +86,13 @@ void InspIRCd::Cleanup() } stats->BoundPortCount = 0; + /* Close all client sockets, or the new process inherits them */ + for (std::vector::const_iterator i = this->local_users.begin(); i != this->local_users.end(); i++) + { + (*i)->SetWriteError("Server shutdown"); + (*i)->CloseSocket(); + } + /* We do this more than once, so that any service providers get a * chance to be unhooked by the modules using them, but then get * a chance to be removed themsleves. @@ -103,10 +110,6 @@ void InspIRCd::Cleanup() this->UnloadModule(mymodnames[k].c_str()); } - /* Close all client sockets, or the new process inherits them */ - for (std::vector::const_iterator i = this->local_users.begin(); i != this->local_users.end(); i++) - (*i)->CloseSocket(); - /* Close logging */ this->Logger->Close(); } -- cgit v1.2.3