summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland/ecore_wl_dnd.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-08 13:44:07 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-08 16:31:30 +0300
commit067753eb2eae9e09cdb54b11aa610fab3716419c (patch)
tree31b41ab569ba1977784cdae79fa78b837487d6c4 /src/lib/ecore_wayland/ecore_wl_dnd.c
parent96b767ef775301a00a7983324a5db3f2c56b7304 (diff)
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.
Diffstat (limited to 'src/lib/ecore_wayland/ecore_wl_dnd.c')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_dnd.c7
1 files changed, 6 insertions, 1 deletions
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)
764} 764}
765 765
766static void 766static void
767_ecore_wl_dnd_source_cb_cancelled(void *data EINA_UNUSED, struct wl_data_source *source) 767_ecore_wl_dnd_source_cb_cancelled(void *data, struct wl_data_source *source)
768{ 768{
769 Ecore_Wl_Input *input;
770
769 LOGFN(__FILE__, __LINE__, __FUNCTION__); 771 LOGFN(__FILE__, __LINE__, __FUNCTION__);
770 772
773 if (!(input = data)) return;
774
771 /* FIXME: Raise an Ecore_Wl_Event here */ 775 /* FIXME: Raise an Ecore_Wl_Event here */
772 wl_data_source_destroy(source); 776 wl_data_source_destroy(source);
777 if (input->data_source == source) input->data_source = NULL;
773} 778}
774 779
775static void 780static void