From: Michael Stapelberg Date: Fri, 27 Jan 2012 21:47:55 +0000 (+0000) Subject: Bugfix: Free old criteria matching window list (Thanks piroko) X-Git-Tag: 4.2~108 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=76ad5dac6348d0aaf606f8a0d05972354851f5d0;p=i3%2Fi3 Bugfix: Free old criteria matching window list (Thanks piroko) --- diff --git a/src/commands.c b/src/commands.c index 4071097f..1991fe27 100644 --- a/src/commands.c +++ b/src/commands.c @@ -328,13 +328,20 @@ void cmd_MIGRATION_validate() { ******************************************************************************/ char *cmd_criteria_init(Match *current_match) { + Con *con; + owindow *ow; + DLOG("Initializing criteria, current_match = %p\n", current_match); match_init(current_match); + while (!TAILQ_EMPTY(&owindows)) { + ow = TAILQ_FIRST(&owindows); + TAILQ_REMOVE(&owindows, ow, owindows); + free(ow); + } TAILQ_INIT(&owindows); /* copy all_cons */ - Con *con; TAILQ_FOREACH(con, &all_cons, all_cons) { - owindow *ow = smalloc(sizeof(owindow)); + ow = smalloc(sizeof(owindow)); ow->con = con; TAILQ_INSERT_TAIL(&owindows, ow, owindows); }