From b1d31afdb8348d23553649ebf79b18ea28a831db Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 20 Mar 2012 08:07:05 +0000 Subject: [PATCH] while hunting down what appears to be a memleak in e17.. my profiling turned up that we keep lots of icons in mem that we don't use. frankly we could do this better as we still may keep multiple copies (inside an evas object as well as in the border netwm icons data etc.), but this is better than keeping 3, 4 or 10 icons of various sizes where we only use 1. SVN revision: 69521 --- src/bin/e_border.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 641ee6d05..26c56a1ea 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -6826,13 +6826,26 @@ _e_border_eval0(E_Border *bd) free(bd->client.netwm.icons); } if (!ecore_x_netwm_icons_get(bd->client.win, - &bd->client.netwm.icons, &bd->client.netwm.num_icons)) + &bd->client.netwm.icons, + &bd->client.netwm.num_icons)) { bd->client.netwm.icons = NULL; bd->client.netwm.num_icons = 0; } else - bd->changes.icon = 1; + { + int i; + + // um;ess the rest of e17 uses border icons OTHER than icon # 0 + // then free the rest that we don't need anymore. + for (i = 1; i < bd->client.netwm.num_icons; i++) + { + free(bd->client.netwm.icons[i].data); + bd->client.netwm.icons[i].data = NULL; + } + bd->client.netwm.num_icons = 1; + bd->changes.icon = 1; + } bd->client.netwm.fetch.icon = 0; } if (bd->client.netwm.fetch.user_time)