mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 16:01:27 +00: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:
parent
214e3030e1
commit
484f7677b0
|
@ -27,6 +27,8 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
memset(&swaynag, 0, sizeof(swaynag));
|
memset(&swaynag, 0, sizeof(swaynag));
|
||||||
swaynag.buttons = create_list();
|
swaynag.buttons = create_list();
|
||||||
|
wl_list_init(&swaynag.outputs);
|
||||||
|
wl_list_init(&swaynag.seats);
|
||||||
|
|
||||||
struct swaynag_button *button_close =
|
struct swaynag_button *button_close =
|
||||||
calloc(sizeof(struct swaynag_button), 1);
|
calloc(sizeof(struct swaynag_button), 1);
|
||||||
|
|
|
@ -437,8 +437,6 @@ void swaynag_setup(struct swaynag *swaynag) {
|
||||||
}
|
}
|
||||||
|
|
||||||
swaynag->scale = 1;
|
swaynag->scale = 1;
|
||||||
wl_list_init(&swaynag->outputs);
|
|
||||||
wl_list_init(&swaynag->seats);
|
|
||||||
|
|
||||||
struct wl_registry *registry = wl_display_get_registry(swaynag->display);
|
struct wl_registry *registry = wl_display_get_registry(swaynag->display);
|
||||||
wl_registry_add_listener(registry, ®istry_listener, swaynag);
|
wl_registry_add_listener(registry, ®istry_listener, swaynag);
|
||||||
|
|
Loading…
Reference in a new issue