From 8456cf5ccd44911f4e56538fe0880dd7fc7cd96d Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 2 Oct 2009 03:15:46 +0000 Subject: Fix valgrind issues and crashes on exit git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11794 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index b815ce4ac..2a9f506bc 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -111,11 +111,15 @@ void InspIRCd::Cleanup() Users->QuitUser(u, "Server shutdown"); } + /* Cleanup Server Names */ + for(servernamelist::iterator itr = servernames.begin(); itr != servernames.end(); ++itr) + delete (*itr); + /* 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. * - * XXX there may be a better way to do this with 1.2 + * XXX there may be a better way to do this */ for (int tries = 0; tries < 4; tries++) { @@ -125,12 +129,9 @@ void InspIRCd::Cleanup() /* Unload all modules, so they get a chance to clean up their listeners */ this->Modules->Unload(k->c_str()); } + GlobalCulls.Apply(); } - /* Cleanup Server Names */ - for(servernamelist::iterator itr = servernames.begin(); itr != servernames.end(); ++itr) - delete (*itr); - /* 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 */ DeleteZero(this->FakeClient); -- cgit v1.3.1-10-gc9f91