From 487eb8e008ca4695e93fa9ccac1211f687da7665 Mon Sep 17 00:00:00 2001 From: Stuart Dilts Date: Sat, 19 Oct 2024 11:38:59 -0600 Subject: [PATCH] hrt: Cleanup destroy signal on input device The destroy listener needs to be removed, as something tries to reference it again. + Attempt to make this easier to see by re-organizing the code a bit --- heart/src/input.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/heart/src/input.c b/heart/src/input.c index 35a9b85..2667483 100644 --- a/heart/src/input.c +++ b/heart/src/input.c @@ -67,7 +67,12 @@ static void input_device_destroy(struct wl_listener *listener, void *data) { break; } + // Signals + wl_list_remove(&input->destroy.link); + wl_list_remove(&input->link); + + uint32_t caps = find_input_caps(input->seat, input); wlr_seat_set_capabilities(input->seat->seat, caps); @@ -82,8 +87,11 @@ static void new_input_notify(struct wl_listener *listener, void *data) { struct hrt_input *input = calloc(1, sizeof(struct hrt_input)); input->wlr_input_device = dev; input->seat = seat; + + /// Signals input->destroy.notify = input_device_destroy; wl_signal_add(&dev->events.destroy, &input->destroy); + wl_list_insert(&seat->inputs, &input->link); switch(dev->type) {