- DeleteZero(this->Res);
- DeleteZero(this->chanlist);
- DeleteZero(this->PI);
- DeleteZero(this->Threads);
- DeleteZero(this->Timers);
- DeleteZero(this->SE);
- /* Close logging */
- this->Logs->CloseLogs();
- DeleteZero(this->Logs);
-}
-
-void InspIRCd::Restart(const std::string &reason)
-{
- /* SendError flushes each client's queue,
- * regardless of writeability state
- */
- this->SendError(reason);
-
- /* Figure out our filename (if theyve renamed it, we're boned) */
- std::string me;
-
-#ifdef WINDOWS
- char module[MAX_PATH];
- if (GetModuleFileName(NULL, module, MAX_PATH))
- me = module;
-#else
- me = Config->MyDir + "/inspircd";
-#endif
-
- char** argv = Config->argv;
-
- this->Cleanup();
-
- if (execv(me.c_str(), argv) == -1)
- {
- /* Will raise a SIGABRT if not trapped */
- throw CoreException(std::string("Failed to execv()! error: ") + strerror(errno));
- }
-}
-
-void InspIRCd::ResetMaxBans()
-{
- for (chan_hash::const_iterator i = chanlist->begin(); i != chanlist->end(); i++)
- i->second->ResetMaxBans();
-}
-
-/** Because hash_map doesnt free its buckets when we delete items (this is a 'feature')
- * we must occasionally rehash the hash (yes really).
- * We do this by copying the entries from the old hash to a new hash, causing all
- * empty buckets to be weeded out of the hash. We dont do this on a timer, as its
- * very expensive, so instead we do it when the user types /REHASH and expects a
- * short delay anyway.
- */
-void InspIRCd::RehashUsersAndChans()
-{
- user_hash* old_users = this->Users->clientlist;
- user_hash* old_uuid = this->Users->uuidlist;
- chan_hash* old_chans = this->chanlist;
-
- this->Users->clientlist = new user_hash();
- this->Users->uuidlist = new user_hash();
- this->chanlist = new chan_hash();
-
- for (user_hash::const_iterator n = old_users->begin(); n != old_users->end(); n++)
- this->Users->clientlist->insert(*n);
-
- delete old_users;
-
- for (user_hash::const_iterator n = old_uuid->begin(); n != old_uuid->end(); n++)
- this->Users->uuidlist->insert(*n);
-
- delete old_uuid;
-
- for (chan_hash::const_iterator n = old_chans->begin(); n != old_chans->end(); n++)
- this->chanlist->insert(*n);
-
- delete old_chans;