core: divehare avoid race problem.

Do reply->readAll() before reply-deleteLater()

With UI deleteLater() seems to happen after the function exist,
but with QML it causes problems.

Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2019-12-12 12:57:56 +01:00 committed by Dirk Hohndel
parent aefe87112a
commit 820d9bcd56

View file

@ -76,12 +76,13 @@ void uploadDiveShare::updateProgressSlot(qint64 current, qint64 total)
void uploadDiveShare::uploadFinishedSlot()
{
QByteArray html = reply->readAll();
reply->deleteLater();
timeout.stop();
if (reply->error() != 0) {
emit uploadFinish(false, reply->errorString(), reply->readAll());
emit uploadFinish(false, reply->errorString(), html);
} else {
emit uploadFinish(true, tr("Upload successful"), reply->readAll());
emit uploadFinish(true, tr("Upload successful"), html);
}
}