void InspIRCd::Cleanup()
{
- if (Config)
+ for (unsigned int i = 0; i < ports.size(); i++)
{
- for (unsigned int i = 0; i < ports.size(); i++)
- {
- /* This calls the constructor and closes the listening socket */
- delete ports[i];
- }
-
- ports.clear();
+ /* This calls the constructor and closes the listening socket */
+ ports[i]->cull();
+ delete ports[i];
}
+ ports.clear();
/* Close all client sockets, or the new process inherits them */
std::vector<User*>::reverse_iterator i = Users->local_users.rbegin();
/* Delete objects dynamically allocated in constructor (destructor would be more appropriate, but we're likely exiting) */
/* Must be deleted before modes as it decrements modelines */
+ if (FakeClient)
+ FakeClient->cull();
DeleteZero(this->FakeClient);
DeleteZero(this->Users);
DeleteZero(this->Modes);