fix: thumbnail memory leak when removing file (#247)

pull/251/head
N-R-K 2 years ago committed by GitHub
parent 590d9fe0a9
commit bf6c062779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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));

Loading…
Cancel
Save