summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-08-30 19:26:33 +0200
committerJared Adams <jaxad0127@gmail.com>2010-08-30 15:19:58 -0600
commitf63a221850062da5b676c7dce258405f59486530 (patch)
treedd5d733a4b264a69489f80fe834a1f334afb0101
parentd55c1345449a34adb3192c23fe3760bd0aae645b (diff)
downloadmana-f63a221850062da5b676c7dce258405f59486530.tar.gz
mana-f63a221850062da5b676c7dce258405f59486530.tar.bz2
mana-f63a221850062da5b676c7dce258405f59486530.tar.xz
mana-f63a221850062da5b676c7dce258405f59486530.zip
Fixing segmentation fault and making invite to guild in pop-up conditional
How to reproduce the segmentation fault: Open the emote pop-up. Then press the escape key and switch the character. The emote pop-up is still open and clicking on it makes the game crash. Signed-off-by: Jared Adams <jaxad0127@gmail.com>
-rw-r--r--src/gui/popupmenu.cpp3
-rw-r--r--src/gui/windowmenu.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 520b4005..01870e62 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -128,7 +128,8 @@ void PopupMenu::showPopup(int x, int y, Being *being)
mBrowserBox->addRow(strprintf("@@follow|%s@@",
strprintf(_("Follow %s"),
name.c_str()).c_str()));
- mBrowserBox->addRow(strprintf("@@guild|%s@@",
+ if (player_node->getNumberOfGuilds())
+ mBrowserBox->addRow(strprintf("@@guild|%s@@",
strprintf(_("Invite %s to join your guild"),
name.c_str()).c_str()));
if (player_node->isInParty())
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index 5af5a202..4b18de89 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -72,6 +72,7 @@ WindowMenu::WindowMenu():
WindowMenu::~WindowMenu()
{
+ delete mEmotePopup;
}
void WindowMenu::action(const gcn::ActionEvent &event)