diff options
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | sway/config.c | 2 | ||||
-rw-r--r-- | sway/main.c | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h index 8907e019..d77872ee 100644 --- a/include/config.h +++ b/include/config.h | |||
@@ -193,6 +193,10 @@ bool load_config(const char *file); | |||
193 | */ | 193 | */ |
194 | bool read_config(FILE *file, bool is_active); | 194 | bool read_config(FILE *file, bool is_active); |
195 | /** | 195 | /** |
196 | * Free config struct | ||
197 | */ | ||
198 | void free_config(struct sway_config *config); | ||
199 | /** | ||
196 | * Does variable replacement for a string based on the config's currently loaded variables. | 200 | * Does variable replacement for a string based on the config's currently loaded variables. |
197 | */ | 201 | */ |
198 | char *do_var_replacement(char *str); | 202 | char *do_var_replacement(char *str); |
diff --git a/sway/config.c b/sway/config.c index 16adaf0d..296e164c 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -86,7 +86,7 @@ static void free_workspace_output(struct workspace_output *wo) { | |||
86 | free(wo); | 86 | free(wo); |
87 | } | 87 | } |
88 | 88 | ||
89 | static void free_config(struct sway_config *config) { | 89 | void free_config(struct sway_config *config) { |
90 | int i; | 90 | int i; |
91 | for (i = 0; i < config->symbols->length; ++i) { | 91 | for (i = 0; i < config->symbols->length; ++i) { |
92 | free_variable(config->symbols->items[i]); | 92 | free_variable(config->symbols->items[i]); |
diff --git a/sway/main.c b/sway/main.c index 7ea392b6..7c712281 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -228,6 +228,10 @@ int main(int argc, char **argv) { | |||
228 | 228 | ||
229 | ipc_terminate(); | 229 | ipc_terminate(); |
230 | 230 | ||
231 | if (config) { | ||
232 | free_config(config); | ||
233 | } | ||
234 | |||
231 | return exit_value; | 235 | return exit_value; |
232 | } | 236 | } |
233 | 237 | ||