diff options
author | N-R-K <79544946+N-R-K@users.noreply.github.com> | 2022-03-27 09:34:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-27 09:34:44 +0000 |
commit | bf6c0627792485bcdefe5aa055bece21ca22bbec (patch) | |
tree | a8c54a7074d1c67b5970e25542f5f181a5f776be | |
parent | 590d9fe0a9573ca72fdbab5119fd2c60dce3dd19 (diff) |
fix: thumbnail memory leak when removing file (#247)
-rw-r--r-- | main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -165,6 +165,10 @@ void remove_file(int n, bool manual) if (n + 1 < filecnt) { if (tns.thumbs != NULL) { + if (tns.thumbs[n].im != NULL) { + imlib_context_set_image(tns.thumbs[n].im); + imlib_free_image_and_decache(); + } memmove(tns.thumbs + n, tns.thumbs + n + 1, (filecnt - n - 1) * sizeof(*tns.thumbs)); memset(tns.thumbs + filecnt - 1, 0, sizeof(*tns.thumbs)); |