From 4b2e0765db3cb348bd974264b1d0f23a90f513e1 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Fri, 6 Jul 2018 20:24:43 +0200 Subject: [PATCH] - cleanup (parent) signals InteractiveWindow after window is closed --- interface/resources/qml/InteractiveWindow.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/InteractiveWindow.qml b/interface/resources/qml/InteractiveWindow.qml index e0290ec5c1..800026710d 100644 --- a/interface/resources/qml/InteractiveWindow.qml +++ b/interface/resources/qml/InteractiveWindow.qml @@ -120,12 +120,8 @@ Windows.Window { Component.onCompleted: { // Fix for parent loss on OSX: - parent.heightChanged.connect(function() { - updateContentParent(); - }); - parent.widthChanged.connect(function() { - updateContentParent(); - }); + parent.heightChanged.connect(updateContentParent); + parent.widthChanged.connect(updateContentParent); x = interactiveWindowPosition.x; y = interactiveWindowPosition.y; @@ -194,6 +190,11 @@ Windows.Window { initialized = true; } + Component.onDestruction: { + parent.heightChanged.disconnect(updateContentParent); + parent.widthChanged.disconnect(updateContentParent); + } + // Handle message traffic from the script that launched us to the loaded QML function fromScript(message) { if (root.dynamicContent && root.dynamicContent.fromScript) {