diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2020-03-29 09:53:52 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-03-29 11:17:32 +0200 |
commit | 484f7677b0d5e07eb0e42d70343c4951ac6f24cf (patch) | |
tree | 58dbae4ec3e461d41bf510cd7e791c6c9e3201ea /swaynag | |
parent | 214e3030e1dc8d30295cb30c8a2397d641c77ebf (diff) |
swaynag: fix segfault on exit when arguments are not correct
swaynag_destroy is called on all cleanup cases and needs the lists to be valid,
just init them early
Diffstat (limited to 'swaynag')
-rw-r--r-- | swaynag/main.c | 2 | ||||
-rw-r--r-- | swaynag/swaynag.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/swaynag/main.c b/swaynag/main.c index 542e3472..c8212415 100644 --- a/swaynag/main.c +++ b/swaynag/main.c @@ -27,6 +27,8 @@ int main(int argc, char **argv) { memset(&swaynag, 0, sizeof(swaynag)); swaynag.buttons = create_list(); + wl_list_init(&swaynag.outputs); + wl_list_init(&swaynag.seats); struct swaynag_button *button_close = calloc(sizeof(struct swaynag_button), 1); diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c index e6fe9b21..06700e47 100644 --- a/swaynag/swaynag.c +++ b/swaynag/swaynag.c @@ -437,8 +437,6 @@ void swaynag_setup(struct swaynag *swaynag) { } swaynag->scale = 1; - wl_list_init(&swaynag->outputs); - wl_list_init(&swaynag->seats); struct wl_registry *registry = wl_display_get_registry(swaynag->display); wl_registry_add_listener(registry, ®istry_listener, swaynag); |