jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=067753eb2eae9e09cdb54b11aa610fab3716419c

commit 067753eb2eae9e09cdb54b11aa610fab3716419c
Author: Daniel Zaoui <daniel.za...@samsung.com>
Date:   Mon Sep 8 13:44:07 2014 +0300

    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 875cf5d..7136ba5 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 

-- 


Reply via email to