summaryrefslogtreecommitdiffstats
path: root/core/imagedownloader.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-02-08 22:09:01 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-03-05 18:04:57 +0200
commit2803b7d3857dc1067f9ec465bf31b9834cbba699 (patch)
tree16bc9f4aae21696823e8612390df2ee2abd39f00 /core/imagedownloader.cpp
parentc1cd2e0f0295c569644c6d5ff186e00b4ce82d30 (diff)
downloadsubsurface-2803b7d3857dc1067f9ec465bf31b9834cbba699.tar.gz
core/imagedownloader.cpp: Simplify deletion of objects
1) Destroying the QNetworkManager seems like a bug: this was a subobject of ImageDonwloader. It's mysterious how this didn't crash. 2) Instead of calling deleteLater() on the reply object, simply delete it after completion. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/imagedownloader.cpp')
-rw-r--r--core/imagedownloader.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/imagedownloader.cpp b/core/imagedownloader.cpp
index cdaa7fc90..f5bc734b2 100644
--- a/core/imagedownloader.cpp
+++ b/core/imagedownloader.cpp
@@ -41,6 +41,7 @@ void ImageDownloader::load(bool fromHash){
loop.processEvents();
sleep(1);
}
+ delete reply;
}
}
@@ -69,8 +70,6 @@ void ImageDownloader::saveImage(QNetworkReply *reply)
add_hash(imageFile.fileName(), hash.result());
learnHash(picture, hash.result());
}
- reply->manager()->deleteLater();
- reply->deleteLater();
// This should be called to make the picture actually show.
// Problem is DivePictureModel is not in core.
// Nevertheless, the image shows when the dive is selected the next time.