summaryrefslogtreecommitdiff
path: root/src/gui/partywindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-10 20:29:14 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-10 21:24:20 +0200
commit3c912139aef92a3e070ade966c91c297b7a5310c (patch)
tree2628e66b9cfe3cd494bb33641ac995db949c01fb /src/gui/partywindow.cpp
parent6e3a3c345a2cad8308738b8b7b5292b9002c1a6e (diff)
downloadmana-client-3c912139aef92a3e070ade966c91c297b7a5310c.tar.gz
mana-client-3c912139aef92a3e070ade966c91c297b7a5310c.tar.bz2
mana-client-3c912139aef92a3e070ade966c91c297b7a5310c.tar.xz
mana-client-3c912139aef92a3e070ade966c91c297b7a5310c.zip
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.
Diffstat (limited to 'src/gui/partywindow.cpp')
-rw-r--r--src/gui/partywindow.cpp25
1 files changed, 16 insertions, 9 deletions
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();
}