From f55b77a98a41ba784109842cde39ba0e1d2bc262 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 6 Oct 2013 16:40:28 +0200 Subject: Fixed memory leaks in the HTTP framework --- source/HTTPServer/HTTPServer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/HTTPServer/HTTPServer.cpp') diff --git a/source/HTTPServer/HTTPServer.cpp b/source/HTTPServer/HTTPServer.cpp index 9636eb59f..f6f5b0f8b 100644 --- a/source/HTTPServer/HTTPServer.cpp +++ b/source/HTTPServer/HTTPServer.cpp @@ -179,9 +179,9 @@ void cHTTPServer::Stop(void) // Drop all current connections: cCSLock Lock(m_CSConnections); - for (cHTTPConnections::iterator itr = m_Connections.begin(), end = m_Connections.end(); itr != end; ++itr) + while (!m_Connections.empty()) { - m_SocketThreads.RemoveClient(*itr); + m_Connections.front()->Terminate(); } // for itr - m_Connections[] } @@ -213,6 +213,7 @@ void cHTTPServer::CloseConnection(cHTTPConnection & a_Connection) break; } } + delete &a_Connection; } -- cgit v1.2.3