diff options
author | Robert Griebl <robert.griebl@qt.io> | 2021-09-22 15:21:29 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-22 16:50:29 +0000 |
commit | 7ec6879492535ecbc5e8fc480d93863c91071e5f (patch) | |
tree | b21841fa98b55e56bee53decc40dddd0ea9e3df4 | |
parent | 73b737e22a831c696bfcd9dea5b268b243d50322 (diff) | |
download | qtapplicationmanager-7ec6879492535ecbc5e8fc480d93863c91071e5f.tar.gz |
Prevent exceptions being thrown through Qt's event loop
Change-Id: I18b20da2b9245205b5fca1034ae63a0a53dafa5e
Reviewed-by: Bernd Weimer <bernd.weimer@qt.io>
(cherry picked from commit 621defdf3addaa70b618e177e90ddfab218d26fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/tools/launcher-qml/launcher-qml.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/launcher-qml/launcher-qml.cpp b/src/tools/launcher-qml/launcher-qml.cpp index b6f2c229..b7481359 100644 --- a/src/tools/launcher-qml/launcher-qml.cpp +++ b/src/tools/launcher-qml/launcher-qml.cpp @@ -430,7 +430,14 @@ void Controller::startApplication(const QString &baseDir, const QString &qmlFile QCoreApplication::instance()->installEventFilter(this); QStringList startupPluginFiles = variantToStringList(m_configuration.value(qSL("plugins")).toMap().value(qSL("startup"))); - auto startupPlugins = loadPlugins<StartupInterface>("startup", startupPluginFiles); + QVector<StartupInterface *> startupPlugins; + try { + startupPlugins = loadPlugins<StartupInterface>("startup", startupPluginFiles); + } catch (const Exception &e) { + qCCritical(LogQmlRuntime) << qPrintable(e.errorString()); + QCoreApplication::exit(2); + return; + } for (StartupInterface *iface : qAsConst(startupPlugins)) iface->initialize(m_applicationInterface ? m_applicationInterface->systemProperties() : QVariantMap()); |