core/imagedownloader.cpp: Fix memory leak

A cloned picture struct would not be freed if the filename was already
in the queued-for-download set.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-02-08 22:05:29 +01:00 committed by Lubomir I. Ivanov
parent 93ddcce6fa
commit c1cd2e0f02

View file

@ -86,8 +86,10 @@ static void loadPicture(struct picture *picture, bool fromHash)
if (!picture)
return;
QMutexLocker locker(&pictureQueueMutex);
if (queuedPictures.contains(QString(picture->filename)))
if (queuedPictures.contains(QString(picture->filename))) {
picture_free(picture);
return;
}
queuedPictures.insert(QString(picture->filename));
locker.unlock();