From f63a221850062da5b676c7dce258405f59486530 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Mon, 30 Aug 2010 19:26:33 +0200 Subject: 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 --- src/gui/popupmenu.cpp | 3 ++- src/gui/windowmenu.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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) -- cgit v1.2.3-70-g09d2