diff options
author | Ulf Hermann <[email protected]> | 2023-04-26 15:26:36 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2023-04-27 10:06:11 +0200 |
commit | 0d10fcbb0ff6d8821957c138757594cc74f075d1 (patch) | |
tree | cb20b42225d12c9c060942bd4a0ccf8feb89c7d6 | |
parent | 100ac19151f17f7b5cd2777f8d487a08268d4727 (diff) |
qml: Construct QQmlApplicationEngine only when we need it
Otherwise we leak a lot of memory if any of the exit() calls is
triggered.
Change-Id: I338abe2ef63217e6b80ffc2f8fe65d9cac03d994
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Semih Yavuz <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
-rw-r--r-- | tools/qml/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 086bd772d7..4e051f82c5 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -425,7 +425,6 @@ int main(int argc, char *argv[]) app->setOrganizationDomain("qt-project.org"); QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - QQmlApplicationEngine e; QStringList files; QString confFile; QString translationFile; @@ -553,6 +552,9 @@ int main(int argc, char *argv[]) if (parser.isSet(fixedAnimationsOption)) QUnifiedTimer::instance()->setConsistentTiming(true); #endif + + QQmlApplicationEngine e; + for (const QString &importPath : parser.values(importOption)) e.addImportPath(importPath); |