aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-05-20 17:07:33 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-05-21 10:38:43 +0200
commit3e5855cf744167e9b985ad53e2caefdc174f96c7 (patch)
treec97cd19875f0e9a97308616639f18d5064f41ddc /tools
parent0b1c7c95e08d1ef0165ff9237c194cfcebdcefce (diff)
qml: Don't leak the created objects
Rather, parent them to the watcher. The watcher lives in the main() function's scope. Change-Id: I2ac1d14d80d4100756a3ad94b6502d46fda30074 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/main.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 865c762bb1..66f9dcba5f 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -271,6 +271,7 @@ void LoadWatcher::contain(QObject *o, const QUrl &containPath)
QObject *o2 = c.create();
if (!o2)
return;
+ o2->setParent(this);
checkForWindow(o2);
bool success = false;
int idx;