From 308031b69cd440534ee076dcaabba93e489b4faf Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 3 May 2010 19:45:11 +0200 Subject: Fix memory leak related to the menu The menu background images were not properly free()d --- TODO | 5 ----- src/menu.c | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index afad558..2164310 100644 --- a/TODO +++ b/TODO @@ -25,8 +25,3 @@ turned on (after that, it'll work for all images in the slideshow). Maybe I'll someday find out how to fix that :> Make --start-at work with paths as well - -Fix Memory leaks in the menu. -Sub-menus generated using the callbacks (feh_menu_func_gen_*) don't get -properly freed. Looks like their background image somehow remains in memory or -something. diff --git a/src/menu.c b/src/menu.c index 63a2047..1002157 100644 --- a/src/menu.c +++ b/src/menu.c @@ -167,6 +167,9 @@ void feh_menu_free(feh_menu * m) } pl = l; } + if (m->bg) + gib_imlib_free_image_and_decache(m->bg); + free(m); D_RETURN_(4); -- cgit v1.2.3