summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-02-23 22:28:30 +0100
committerDaniel Friesel <derf@finalrewind.org>2017-02-23 22:28:30 +0100
commitf05ba61aefee0b5a1f3c3c6413dd5501505f3ef4 (patch)
tree29b1302cd5aeb0e6f5e4f3ee84b2495af5a61815 /src
parentf27be5de2fde7e3a8be0d63e025c801ec7df5475 (diff)
Fix memory leak when closing images opened from thumbnail mode
Diffstat (limited to 'src')
-rw-r--r--src/slideshow.c1
-rw-r--r--src/winwidget.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index b57d5c5..4a71dc3 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -686,6 +686,7 @@ void feh_filelist_image_remove(winwidget winwid, char do_delete)
filelist = feh_file_rm_and_free(filelist, winwid->file);
else
filelist = feh_file_remove_from_list(filelist, winwid->file);
+ winwid->file = NULL;
winwidget_destroy(winwid);
}
}
diff --git a/src/winwidget.c b/src/winwidget.c
index dae7bc9..707b060 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -755,6 +755,8 @@ void winwidget_destroy(winwidget winwid)
free(winwid->name);
if (winwid->gc)
XFreeGC(disp, winwid->gc);
+ if ((winwid->type == WIN_TYPE_THUMBNAIL_VIEWER) && (winwid->file != NULL))
+ gib_list_free(winwid->file);
if (winwid->im)
gib_imlib_free_image_and_decache(winwid->im);
free(winwid);