From 436e4c17b30ab36535d0bb02f25906a8d8f3954e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 9 Jan 2016 14:18:16 +0100 Subject: [PATCH] free container matches when destroying containers --- src/tree.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tree.c b/src/tree.c index 5a6129ac..5ff426ca 100644 --- a/src/tree.c +++ b/src/tree.c @@ -328,6 +328,12 @@ bool tree_close_internal(Con *con, kill_window_t kill_window, bool dont_kill_par free(con->name); FREE(con->deco_render_params); TAILQ_REMOVE(&all_cons, con, all_cons); + while (!TAILQ_EMPTY(&(con->swallow_head))) { + Match *match = TAILQ_FIRST(&(con->swallow_head)); + TAILQ_REMOVE(&(con->swallow_head), match, matches); + match_free(match); + free(match); + } free(con); /* in the case of floating windows, we already focused another container -- 2.39.5