aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 33f5cde..e3ee016 100644
--- a/main.c
+++ b/main.c
@@ -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));