aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qml/main.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-07-08 14:32:44 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-08-10 16:00:08 +0200
commit19d2e70ad7051a80e51694aa1a372d817269829b (patch)
tree561fe74c898c4803cc28c747e76b49604dbd0889 /tools/qml/main.cpp
parentca54207517a731e987b6beb8004baee1b81399ed (diff)
qml: Avoid memory leaks when no objects are loaded
Instead of std::exit() use the early return mechanism we already have so that any existing objects are gracefully destroyed. Change-Id: Icb197879cc33ab22f07fc1486da44f9ff5b177bc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tools/qml/main.cpp')
-rw-r--r--tools/qml/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 66f9dcba5f..3dd6a4de5c 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -242,7 +242,8 @@ public Q_SLOTS:
if (! --expectedFileCount) {
printf("qml: Did not load any objects, exiting.\n");
- std::exit(2); // Different return code from qFatal
+ exit(2);
+ QCoreApplication::exit(2);
}
}