From 5e58d46cc1a90810e3ee76203cee8ca2f14fb462 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 12 Feb 2018 09:12:31 +0100 Subject: Add wlr_signal_emit_safe --- backend/headless/backend.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'backend/headless/backend.c') diff --git a/backend/headless/backend.c b/backend/headless/backend.c index 0bf5ec28..7832b00c 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include "backend/headless.h" @@ -16,14 +17,14 @@ static bool backend_start(struct wlr_backend *wlr_backend) { wl_list_for_each(output, &backend->outputs, link) { wl_event_source_timer_update(output->frame_timer, output->frame_delay); wlr_output_update_enabled(&output->wlr_output, true); - wl_signal_emit(&backend->backend.events.output_add, + wlr_signal_emit_safe(&backend->backend.events.output_add, &output->wlr_output); } struct wlr_headless_input_device *input_device; wl_list_for_each(input_device, &backend->input_devices, wlr_input_device.link) { - wl_signal_emit(&backend->backend.events.input_add, + wlr_signal_emit_safe(&backend->backend.events.input_add, &input_device->wlr_input_device); } @@ -51,7 +52,7 @@ static void backend_destroy(struct wlr_backend *wlr_backend) { wlr_input_device_destroy(&input_device->wlr_input_device); } - wl_signal_emit(&wlr_backend->events.destroy, backend); + wlr_signal_emit_safe(&wlr_backend->events.destroy, backend); wlr_egl_finish(&backend->egl); free(backend); -- cgit v1.2.3