diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-29 17:04:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-29 17:04:14 +0300 |
commit | c16e6af9d3b0390dbc3947d3376f4ca4ae1f5fc5 (patch) | |
tree | 61c7b0deea97c8c1c772512069c4fc7af928e662 /src/gui/whoisonline.cpp | |
parent | 14226518bf85a73b1cc2f5290df5f593ad170be1 (diff) | |
download | ManaVerse-c16e6af9d3b0390dbc3947d3376f4ca4ae1f5fc5.tar.gz ManaVerse-c16e6af9d3b0390dbc3947d3376f4ca4ae1f5fc5.tar.bz2 ManaVerse-c16e6af9d3b0390dbc3947d3376f4ca4ae1f5fc5.tar.xz ManaVerse-c16e6af9d3b0390dbc3947d3376f4ca4ae1f5fc5.zip |
Fix memory leak in tathena online list introduced
in commit 40f34b7ba7317f5f5c3dfbed0b291be9555d3137.
Diffstat (limited to 'src/gui/whoisonline.cpp')
-rw-r--r-- | src/gui/whoisonline.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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<OnlinePlayer*>::iterator itd = mOnlinePlayers.begin(); + std::set<OnlinePlayer*>::iterator itd_end = mOnlinePlayers.end(); + + for (; itd != itd_end; ++ itd) + delete *itd; + mOnlinePlayers.clear(); mOnlineNicks.clear(); |