From 185061a12667faf18d67b21c007173f40be009c8 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Thu, 21 Nov 2024 21:57:10 +0000 Subject: [PATCH] Fix rare, intermittent dnd crash Set source to NULL to avoid passing null to wl_signal_emit_mutable() in wlr_data_source_destroy() Ref: - https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/types/data_device/wlr_data_source.c#L38 - https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/types/data_device/wlr_data_device.c?ref_type=heads#L194 Fixes #2287 #2371 --- src/dnd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dnd.c b/src/dnd.c index eeca114a..4a59edc5 100644 --- a/src/dnd.c +++ b/src/dnd.c @@ -21,6 +21,7 @@ handle_drag_request(struct wl_listener *listener, void *data) event->serial); } else { wlr_data_source_destroy(event->drag->source); + event->drag->source = NULL; wlr_log(WLR_ERROR, "wrong source for drag request"); } }