Commit 48fd9d60 authored by Kai Koehne's avatar Kai Koehne
Browse files

Updater: Fix crash on exit



Make sure we wait for the updater thread before deleting the
object.

Change-Id: I1bcc2c7d7f4567a3bd1bad393e039ee0e45a24ec
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 410ae45c
......@@ -91,6 +91,9 @@ UpdateInfoPlugin::UpdateInfoPlugin()
UpdateInfoPlugin::~UpdateInfoPlugin()
{
d->lastCheckUpdateInfoTask.cancel();
d->lastCheckUpdateInfoTask.waitForFinished();
delete d;
}
......@@ -230,7 +233,14 @@ QDomDocument UpdateInfoPlugin::update()
// start
QProcess updater;
updater.start(d->updaterProgram, QStringList() << d->updaterCheckOnlyArgument);
updater.waitForFinished();
while (updater.state() != QProcess::NotRunning) {
if (!updater.waitForFinished(1000)
&& d->lastCheckUpdateInfoTask.isCanceled()) {
updater.kill();
updater.waitForFinished(-1);
return QDomDocument();
}
}
// process return value
QDomDocument updates;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment