From 10c0aa08b84a0a26c9c642f2dbfee6e8b11efb83 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Mon, 8 Feb 2010 23:13:50 -0500 Subject: [PATCH] lbxgui: Make an effort to not leak resources. --- src/gui/lbxgui.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/lbxgui.c b/src/gui/lbxgui.c index ebb92ab..21256e4 100644 --- a/src/gui/lbxgui.c +++ b/src/gui/lbxgui.c @@ -203,6 +203,11 @@ static int init_framedata(int reset) static int img_close(void *handle) { + if (framebuf) { + g_object_unref(framebuf); + framebuf = NULL; + } + lbx_file_close(handle); return 0; } @@ -281,6 +286,11 @@ void set_image_data(GtkComboBox *combo) f = lbx_file_open(lbx, index); if (f) { + if (image) { + lbximg_close(image); + image = NULL; + } + image = lbximg_open(f, &lbx_arch_fops, img_close); if (image) { memset(palette_internal, 0, sizeof palette_internal); -- 2.43.0