Esempio n. 1
0
void InspIRCd::Cleanup()
{
	// Close all listening sockets
	for (unsigned int i = 0; i < ports.size(); i++)
	{
		ports[i]->cull();
		delete ports[i];
	}
	ports.clear();

	/* Close all client sockets, or the new process inherits them */
	LocalUserList& list = Users->local_users;
	for (LocalUserList::iterator i = list.begin(); i != list.end(); ++i)
		Users->QuitUser(*i, "Server shutdown");

	GlobalCulls.Apply();
	Modules->UnloadAll();

	/* 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)
	{
		delete FakeClient->server;
		FakeClient->cull();
	}
	DeleteZero(this->FakeClient);
	DeleteZero(this->XLines);
	DeleteZero(this->Config);
	SocketEngine::Deinit();
	Logs->CloseLogs();
}
Esempio n. 2
0
void InspIRCd::Cleanup()
{
	// Close all listening sockets
	for (unsigned int i = 0; i < ports.size(); i++)
	{
		ports[i]->cull();
		delete ports[i];
	}
	ports.clear();

	GlobalCulls.Apply();
	Modules.UnloadAll();

	/* 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)
	{
		delete FakeClient->server;
		FakeClient->cull();
	}
	DeleteZero(this->FakeClient);
	DeleteZero(this->XLines);
	DeleteZero(this->Config);
	SocketEngine::Deinit();
	Logs.CloseLogs();
}
Esempio n. 3
0
void InspIRCd::Cleanup()
{
    for (unsigned int i = 0; i < ports.size(); i++)
    {
        /* 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 */
    LocalUserList::reverse_iterator i = Users->local_users.rbegin();
    while (i != this->Users->local_users.rend())
    {
        User* u = *i++;
        Users->QuitUser(u, "Server shutdown");
    }

    GlobalCulls.Apply();
    Modules->UnloadAll();

    /* 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);
    DeleteZero(this->XLines);
    DeleteZero(this->Parser);
    DeleteZero(this->stats);
    DeleteZero(this->Modules);
    DeleteZero(this->BanCache);
    DeleteZero(this->SNO);
    DeleteZero(this->Config);
    DeleteZero(this->chanlist);
    DeleteZero(this->PI);
    DeleteZero(this->Threads);
    DeleteZero(this->Timers);
    DeleteZero(this->SE);
    /* Close logging */
    this->Logs->CloseLogs();
    DeleteZero(this->Logs);
}