From c16e6af9d3b0390dbc3947d3376f4ca4ae1f5fc5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 29 Jan 2012 17:04:14 +0300 Subject: Fix memory leak in tathena online list introduced in commit 40f34b7ba7317f5f5c3dfbed0b291be9555d3137. --- src/gui/whoisonline.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index ea86318a3..5dff3d503 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -335,6 +335,13 @@ void WhoIsOnline::loadWebList() // Tokenize and add each line separately char *line = strtok(mMemoryBuffer, "\n"); const std::string gmText = "(GM)"; + + std::set::iterator itd = mOnlinePlayers.begin(); + std::set::iterator itd_end = mOnlinePlayers.end(); + + for (; itd != itd_end; ++ itd) + delete *itd; + mOnlinePlayers.clear(); mOnlineNicks.clear(); -- cgit v1.2.3-70-g09d2