fix: thumbnail memory leak when removing file (#247)
This commit is contained in:
parent
590d9fe0a9
commit
bf6c062779
4
main.c
4
main.c
@ -165,6 +165,10 @@ void remove_file(int n, bool manual)
|
|||||||
|
|
||||||
if (n + 1 < filecnt) {
|
if (n + 1 < filecnt) {
|
||||||
if (tns.thumbs != NULL) {
|
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) *
|
memmove(tns.thumbs + n, tns.thumbs + n + 1, (filecnt - n - 1) *
|
||||||
sizeof(*tns.thumbs));
|
sizeof(*tns.thumbs));
|
||||||
memset(tns.thumbs + filecnt - 1, 0, sizeof(*tns.thumbs));
|
memset(tns.thumbs + filecnt - 1, 0, sizeof(*tns.thumbs));
|
||||||
|
Loading…
Reference in New Issue
Block a user