summaryrefslogtreecommitdiffstats
path: root/core/uploadDiveShare.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2019-12-12 12:57:56 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-12 10:10:01 -0500
commit820d9bcd56ace31035148fcfbb2567dcf3792ac8 (patch)
treea9313d9012420f7bbd524514ab67a5a30067d139 /core/uploadDiveShare.cpp
parentaefe87112ae5549714956b34e7f5a4deaab60e09 (diff)
downloadsubsurface-820d9bcd56ace31035148fcfbb2567dcf3792ac8.tar.gz
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>
Diffstat (limited to 'core/uploadDiveShare.cpp')
-rw-r--r--core/uploadDiveShare.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/uploadDiveShare.cpp b/core/uploadDiveShare.cpp
index 3d75abf9a..8d5858e00 100644
--- a/core/uploadDiveShare.cpp
+++ b/core/uploadDiveShare.cpp
@@ -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);
}
}