From ed0f26678c9aa154d3af441762b9a3ad5345747c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Nov 2011 05:26:02 +0300 Subject: Fix memory leak in char selection dialog. --- src/net/ea/charserverhandler.cpp | 7 +++++++ src/net/ea/charserverhandler.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'src/net/ea') diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index d71236496..63e267584 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -33,6 +33,7 @@ #include "net/ea/loginhandler.h" #include "net/ea/eaprotocol.h" +#include "utils/dtor.h" #include "utils/gettext.h" #include "resources/chardb.h" @@ -184,4 +185,10 @@ void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg A_UNUSED) new OkDialog(_("Error"), _("Failed to delete character.")); } +void CharServerHandler::clear() +{ + delete_all(mCharacters); + mCharacters.clear(); +} + } // namespace Ea diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h index bd39781cd..bab941503 100644 --- a/src/net/ea/charserverhandler.h +++ b/src/net/ea/charserverhandler.h @@ -78,6 +78,8 @@ class CharServerHandler : public Net::CharHandler virtual void processCharDeleteFailed(Net::MessageIn &msg); + virtual void clear(); + protected: virtual void readPlayerData(Net::MessageIn &msg, Net::Character *character, -- cgit v1.2.3-70-g09d2