From 5ec9a51356ca4d55358dbc4c2d4c1e1b881073d9 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Wed, 17 Aug 2022 15:00:24 +0900 Subject: [PATCH] data_device: Nullify {drag,offer}->source This is to prevent the data_source from being destroyed repeatedly. Change-Id: I5ce1efed2b81dabc8d7c8d9b5f8dea3b20b67fa7 --- src/data_device/data_offer.c | 4 ++++ src/data_device/drag.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/data_device/data_offer.c b/src/data_device/data_offer.c index b8fd0ad..eff2406 100644 --- a/src/data_device/data_offer.c +++ b/src/data_device/data_offer.c @@ -138,6 +138,10 @@ data_offer_handle_source_destroy(struct wl_listener *listener, void *data) struct ds_data_offer *offer; offer = wl_container_of(listener, offer, source_destroy); + + wl_list_remove(&offer->source_destroy.link); + offer->source = NULL; + data_offer_destroy(offer); } diff --git a/src/data_device/drag.c b/src/data_device/drag.c index 066e93e..0f64ba2 100644 --- a/src/data_device/drag.c +++ b/src/data_device/drag.c @@ -193,6 +193,10 @@ drag_handle_source_destroy(struct wl_listener *listener, void *data) struct ds_drag *drag; drag = wl_container_of(listener, drag, source_destroy); + + wl_list_remove(&drag->source_destroy.link); + drag->source = NULL; + drag_destroy(drag); } -- 2.7.4