From f3e45bfb0e74d431fcb4a2fcd0c024f73f73e7c2 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 19 Oct 2009 04:09:38 +0000 Subject: Valgrind now runs completely clean. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11916 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 862aa31d0..8b1bd3e44 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -90,16 +90,13 @@ template static void DeleteZero(T*&n) 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::reverse_iterator i = Users->local_users.rbegin(); -- cgit v1.2.3