From f7a0453543a43b3f5b0f603c7dfdf6cc1fd33808 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Fri, 13 Jan 2017 18:28:29 +0100 Subject: [PATCH] Free trayclient when removing it. (#2632) fixes #2619 --- i3bar/src/xcb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 2715e447..49c8de1c 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -870,11 +870,13 @@ static void handle_destroy_notify(xcb_destroy_notify_event_t *event) { DLOG("checking output %s\n", walk->name); trayclient *trayclient; TAILQ_FOREACH(trayclient, walk->trayclients, tailq) { - if (trayclient->win != event->window) + if (trayclient->win != event->window) { continue; + } DLOG("Removing tray client with window ID %08x\n", event->window); TAILQ_REMOVE(walk->trayclients, trayclient, tailq); + FREE(trayclient); /* Trigger an update, we now have more space for the statusline */ configure_trayclients(); @@ -1558,6 +1560,7 @@ void kick_tray_clients(i3_output *output) { /* We remove the trayclient right here. We might receive an UnmapNotify * event afterwards, but better safe than sorry. */ TAILQ_REMOVE(output->trayclients, trayclient, tailq); + FREE(trayclient); } /* Fake a DestroyNotify so that Qt re-adds tray icons. -- 2.39.5