From bc4957b24e6939f4e681e9412f9bbdd483a6bc35 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 4 Jun 2015 22:51:17 +0300 Subject: Fix removing listeners from window if used guitable as container. This fixing crash with settings window after reconnect to server. --- src/gui/widgets/label.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui/widgets/label.cpp') 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; -- cgit v1.2.3-70-g09d2