summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2018-02-14 15:47:40 +0100
committerDominik Holland <dominik.holland@pelagicore.com>2018-02-14 14:52:33 +0000
commit06f3adf84ee4fc2287def8ca1c6b4036409f5c86 (patch)
tree1798ed0bbdae480ee471c2aa3c7426d1c9e095ef
parent8764748b7df3f966ec0dcf22a42524d811d43c13 (diff)
Fix crash when trying to install an app while its runtime is not available
Task-number: QTAUTO-784 Change-Id: I8e511b4311001c2da1aa3684b1e1d87d5a36ba06 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rw-r--r--src/installer-lib/installationtask.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/installer-lib/installationtask.cpp b/src/installer-lib/installationtask.cpp
index ca5f7058..76e281d7 100644
--- a/src/installer-lib/installationtask.cpp
+++ b/src/installer-lib/installationtask.cpp
@@ -326,7 +326,7 @@ void InstallationTask::checkExtractedFile(const QString &file) Q_DECL_NOEXCEPT_E
}
if (m_foundIcon && m_foundInfo) {
- qCDebug(LogInstaller) << "emit requestingInstallationAcknowledge" << id() << "<app>";
+ qCDebug(LogInstaller) << "emit requestingInstallationAcknowledge" << id() << "for app" << m_app->id();
emit m_ai->taskRequestingInstallationAcknowledge(id(), m_app->toVariantMap());
QDir oldDestinationDirectory = m_extractor->destinationDirectory();
@@ -356,6 +356,7 @@ void InstallationTask::checkExtractedFile(const QString &file) Q_DECL_NOEXCEPT_E
// this will also exclusively lock the application for us
// m_app ownership is transferred to the ApplicationManager
m_app->moveToThread(ApplicationManager::instance()->thread());
+ QString appId = m_app->id(); // m_app is gone after the invoke
QMetaObject::invokeMethod(ApplicationManager::instance(),
"startingApplicationInstallation",
Qt::BlockingQueuedConnection,
@@ -363,7 +364,7 @@ void InstallationTask::checkExtractedFile(const QString &file) Q_DECL_NOEXCEPT_E
// ugly, but Q_ARG chokes on QT_PREPEND_NAMESPACE_AM...
QArgument<QT_PREPEND_NAMESPACE_AM(Application *)>(QT_STRINGIFY(QT_PREPEND_NAMESPACE_AM(Application *)), m_app.take()));
if (!m_managerApproval)
- throw Exception("Application Manager declined the installation of %1").arg(m_app->id());
+ throw Exception("Application Manager declined the installation of %1").arg(appId);
// we're not interested in any other files from here on...
m_extractor->setFileExtractedCallback(nullptr);