possible fix for #231

This commit is contained in:
Vadim Lopatin 2016-04-18 10:52:46 +03:00
parent 8b28219174
commit 0e3a2b8c51
1 changed files with 4 additions and 2 deletions

View File

@ -174,9 +174,11 @@ class Window : CustomEventTarget {
@property uint keyboardModifiers() const { return _keyboardModifiers; }
@property Widget mainWidget() { return _mainWidget; }
@property void mainWidget(Widget widget) {
if (_mainWidget !is null)
if (_mainWidget !is null) {
_mainWidget.window = null;
_mainWidget = widget;
destroy(_mainWidget);
}
_mainWidget = widget;
if (_mainWidget !is null)
_mainWidget.window = this;
}