mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue