1
1
mirror of https://github.com/swaywm/sway synced 2024-11-23 13:22:17 +01:00

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
This commit is contained in:
Dominique Martinet 2020-03-29 09:53:52 +02:00 committed by Simon Ser
parent 214e3030e1
commit 484f7677b0
2 changed files with 2 additions and 2 deletions

@ -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);

@ -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, &registry_listener, swaynag);