From 067753eb2eae9e09cdb54b11aa610fab3716419c Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Mon, 8 Sep 2014 13:44:07 +0300 Subject: [PATCH] Ecore/Wayland: fix memory issue on exit. When the application exits, an event cancels the DnD, that invokes the Wayland release of data source but this was not setting an internal pointer to NULL. ecore_wl_shutdown was then trying to use the same Wayland API on the non-set internal pointer (via _ecore_wl_input_del), that was leading to a segmentation fault. This bug never occurred because some bug in Copy&Paste was preventing it to reach this part of code. --- src/lib/ecore_wayland/ecore_wl_dnd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c index 875cf5daf8..7136ba570d 100644 --- a/src/lib/ecore_wayland/ecore_wl_dnd.c +++ b/src/lib/ecore_wayland/ecore_wl_dnd.c @@ -764,12 +764,17 @@ _ecore_wl_dnd_source_cb_send_free(void *data EINA_UNUSED, void *event) } static void -_ecore_wl_dnd_source_cb_cancelled(void *data EINA_UNUSED, struct wl_data_source *source) +_ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source) { + Ecore_Wl_Input *input; + LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!(input = data)) return; + /* FIXME: Raise an Ecore_Wl_Event here */ wl_data_source_destroy(source); + if (input->data_source == source) input->data_source = NULL; } static void