summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-22 21:19:28 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-22 21:22:05 +0100
commitc9dbf0842f3d06e262befb2be2d15ad24b95de85 (patch)
treeb60316f7382a6d063e4171b2c3be83f38d12518a
parentb643164b08597190ba136643c5ffe555dcab7a23 (diff)
downloadmana-client-c9dbf0842f3d06e262befb2be2d15ad24b95de85.tar.gz
mana-client-c9dbf0842f3d06e262befb2be2d15ad24b95de85.tar.bz2
mana-client-c9dbf0842f3d06e262befb2be2d15ad24b95de85.tar.xz
mana-client-c9dbf0842f3d06e262befb2be2d15ad24b95de85.zip
Fixed crash on exit when you're part of a guild
When the ChannelTab gets deleted by the Channel, the ChatWindow may have already been removed. So before telling it that the tab got deleted, check whether it's still there. Reviewed-by: Jared Adams
-rw-r--r--src/gui/widgets/channeltab.cpp3
-rw-r--r--src/gui/widgets/chattab.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/widgets/channeltab.cpp b/src/gui/widgets/channeltab.cpp
index 32d6041f..a7370a4c 100644
--- a/src/gui/widgets/channeltab.cpp
+++ b/src/gui/widgets/channeltab.cpp
@@ -37,9 +37,6 @@ ChannelTab::ChannelTab(Channel *channel) :
ChannelTab::~ChannelTab()
{
- // Clear tab so the channel won't try to delete it again (otherwise we'd
- // run into issues if the ChatWindow is deleted before the channels are)
- mChannel->setTab(0);
}
void ChannelTab::handleInput(const std::string &msg)
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 4b1772d8..d2221255 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -64,7 +64,9 @@ ChatTab::ChatTab(const std::string &name) : Tab()
ChatTab::~ChatTab()
{
- chatWindow->removeTab(this);
+ if (chatWindow)
+ chatWindow->removeTab(this);
+
delete mTextOutput;
delete mScrollArea;
}