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:
parent
93ddcce6fa
commit
c1cd2e0f02
@ -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();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user