summaryrefslogtreecommitdiff
path: root/src/gui/widgets/label.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-04 22:51:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-04 22:51:17 +0300
commitbc4957b24e6939f4e681e9412f9bbdd483a6bc35 (patch)
tree26f151a039a24f294774d32a4e1f89ceaa6ae2af /src/gui/widgets/label.cpp
parentfe84fc25906d6cc6801f9e15cf2652e1d16419ca (diff)
downloadmanaverse-bc4957b24e6939f4e681e9412f9bbdd483a6bc35.tar.gz
manaverse-bc4957b24e6939f4e681e9412f9bbdd483a6bc35.tar.bz2
manaverse-bc4957b24e6939f4e681e9412f9bbdd483a6bc35.tar.xz
manaverse-bc4957b24e6939f4e681e9412f9bbdd483a6bc35.zip
Fix removing listeners from window if used guitable as container.
This fixing crash with settings window after reconnect to server.
Diffstat (limited to 'src/gui/widgets/label.cpp')
-rw-r--r--src/gui/widgets/label.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index e3ba34d26..722e1bbe9 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -269,6 +269,19 @@ void Label::setParent(Widget *widget)
Widget::setParent(widget);
}
+void Label::setWindow(Widget *const widget)
+{
+ if (!widget && mWindow)
+ {
+ mWindow->removeWidgetListener(this);
+ mWindow = nullptr;
+ }
+ else
+ {
+ Widget2::setWindow(widget);
+ }
+}
+
void Label::widgetHidden(const Event &event A_UNUSED)
{
mTextChanged = true;