From 3c912139aef92a3e070ade966c91c297b7a5310c Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 10 May 2009 20:29:14 +0200 Subject: Fixed the resize grip of the party window It wasn't re-added after doing a clear. Also, don't leak all the PartyMember and Avatar instances. --- src/gui/partywindow.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/gui/partywindow.cpp') diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp index 5172f4bb..0479f0fe 100644 --- a/src/gui/partywindow.cpp +++ b/src/gui/partywindow.cpp @@ -30,7 +30,19 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -PartyWindow::PartyWindow() : Window(_("Party")) +PartyMember::PartyMember(): + avatar(new Avatar) +{ +} + +PartyMember::~PartyMember() +{ + delete avatar; +} + + +PartyWindow::PartyWindow() : + Window(_("Party")) { setWindowName("Party"); setVisible(false); @@ -50,11 +62,6 @@ PartyWindow::~PartyWindow() delete_all(mMembers); } -void PartyWindow::draw(gcn::Graphics *graphics) -{ - Window::draw(graphics); -} - PartyMember *PartyWindow::findMember(int id) const { PartyList::const_iterator it = mMembers.find(id); @@ -71,7 +78,6 @@ PartyMember *PartyWindow::findOrCreateMember(int id) if (!member) { member = new PartyMember; - member->avatar = new Avatar(""); mMembers[id] = member; add(member->avatar, 0, (mMembers.size() - 1) * 14); } @@ -195,9 +201,10 @@ void PartyWindow::action(const gcn::ActionEvent &event) } } -void PartyWindow::clear() +void PartyWindow::clearMembers() { - Window::clear(); + clearLayout(); + delete_all(mMembers); mMembers.clear(); } -- cgit v1.2.3-70-g09d2