summaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authoremersion <[email protected]>2018-01-22 01:16:23 +0100
committerGitHub <[email protected]>2018-01-22 01:16:23 +0100
commit0c58673c6a108ba241419a0f1d5fecd47f22370e (patch)
treec3e19af6dd70f04fc5c617e932b4afcc7a1b41d9 /sway/config.c
parenta6bc46eea9d7dec6a2b93f85bac2e3737e0c6725 (diff)
parentbeb3805cf0300bc2640290233aa763d757c12466 (diff)
Merge pull request #1574 from acrisci/config-refactor
Command criteria
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/config.c b/sway/config.c
index cbd9a8b2..1fd123b7 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -54,6 +54,8 @@ static void free_mode(struct sway_mode *mode) {
}
void free_config(struct sway_config *config) {
+ config_clear_handler_context(config);
+
int i;
if (!config) {
@@ -485,6 +487,12 @@ bool load_include_configs(const char *path, struct sway_config *config) {
return true;
}
+void config_clear_handler_context(struct sway_config *config) {
+ free_input_config(config->handler_context.input_config);
+ free_seat_config(config->handler_context.seat_config);
+
+ memset(&config->handler_context, 0, sizeof(config->handler_context));
+}
bool read_config(FILE *file, struct sway_config *config) {
bool success = true;
@@ -597,14 +605,11 @@ bool read_config(FILE *file, struct sway_config *config) {
case CMD_BLOCK_INPUT:
wlr_log(L_DEBUG, "End of input block");
- free_input_config(current_input_config);
- current_input_config = NULL;
block = CMD_BLOCK_END;
break;
case CMD_BLOCK_SEAT:
wlr_log(L_DEBUG, "End of seat block");
- current_seat_config = NULL;
block = CMD_BLOCK_END;
break;
@@ -640,6 +645,7 @@ bool read_config(FILE *file, struct sway_config *config) {
default:;
}
+ config_clear_handler_context(config);
default:;
}
free(line);