From 600676688a47bde05bc12110818127c5300dd876 Mon Sep 17 00:00:00 2001 From: frsfnrrg Date: Tue, 17 Jul 2018 11:19:32 -0400 Subject: Free individual criteria in free_config Also free cmd_list when cleaning up a struct criteria. --- sway/config.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index 2c051146..c620e4c7 100644 --- a/sway/config.c +++ b/sway/config.c @@ -24,6 +24,7 @@ #include "sway/input/seat.h" #include "sway/commands.h" #include "sway/config.h" +#include "sway/criteria.h" #include "sway/tree/arrange.h" #include "sway/tree/layout.h" #include "sway/tree/workspace.h" @@ -105,7 +106,12 @@ void free_config(struct sway_config *config) { } list_free(config->seat_configs); } - list_free(config->criteria); + if (config->criteria) { + for (int i = 0; i < config->criteria->length; ++i) { + criteria_destroy(config->criteria->items[i]); + } + list_free(config->criteria); + } list_free(config->no_focus); list_free(config->active_bar_modifiers); list_free(config->config_chain); -- cgit v1.2.3