From 2803b7d3857dc1067f9ec465bf31b9834cbba699 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 8 Feb 2018 22:09:01 +0100 Subject: 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 --- core/imagedownloader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/imagedownloader.cpp') 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. -- cgit v1.2.3-70-g09d2