summaryrefslogtreecommitdiff
path: root/src/gui/widgets/whispertab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-04 21:58:18 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-04 21:58:18 +0300
commitf664dcdffee192d0e61f0e9e990fbd4fcb168ca0 (patch)
tree80adb115404efd4614b072d8b3343c46eb2c0e0b /src/gui/widgets/whispertab.cpp
parent41115f28f500f3acde44c9118b157f81d8ad6078 (diff)
downloadManaVerse-f664dcdffee192d0e61f0e9e990fbd4fcb168ca0.tar.gz
ManaVerse-f664dcdffee192d0e61f0e9e990fbd4fcb168ca0.tar.bz2
ManaVerse-f664dcdffee192d0e61f0e9e990fbd4fcb168ca0.tar.xz
ManaVerse-f664dcdffee192d0e61f0e9e990fbd4fcb168ca0.zip
Fix crash in closing chat tabs by mod key + right click.
Diffstat (limited to 'src/gui/widgets/whispertab.cpp')
-rw-r--r--src/gui/widgets/whispertab.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/widgets/whispertab.cpp b/src/gui/widgets/whispertab.cpp
index 45e1b12c4..dbca226a8 100644
--- a/src/gui/widgets/whispertab.cpp
+++ b/src/gui/widgets/whispertab.cpp
@@ -29,6 +29,8 @@
#include "net/chathandler.h"
#include "net/net.h"
+#include "gui/widgets/windowcontainer.h"
+
#include "utils/gettext.h"
#include "debug.h"
@@ -137,7 +139,10 @@ bool WhisperTab::handleCommand(const std::string &type,
}
else if (type == "close")
{
- delete this;
+ if (windowContainer)
+ windowContainer->scheduleDelete(this);
+ else
+ delete this;
if (chatWindow)
chatWindow->defaultTab();
}