diff options
-rw-r--r-- | src/inspircd.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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<userrec*>::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<userrec*>::const_iterator i = this->local_users.begin(); i != this->local_users.end(); i++) - (*i)->CloseSocket(); - /* Close logging */ this->Logger->Close(); } |