devilhorns pushed a commit to branch master.

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

commit a0848910138e3b45db23875ee8603e9e34c6673d
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Sep 30 13:01:23 2015 -0400

    ecore-wl2: Cleanup dnd drag and selection sources when we delete an
    input
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/ecore_wl2_dnd.c     | 26 +++++++++++++-------------
 src/lib/ecore_wl2/ecore_wl2_input.c   |  4 ++--
 src/lib/ecore_wl2/ecore_wl2_private.h |  1 +
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c 
b/src/lib/ecore_wl2/ecore_wl2_dnd.c
index 7390eb8..13cc87b 100644
--- a/src/lib/ecore_wl2/ecore_wl2_dnd.c
+++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c
@@ -38,19 +38,6 @@ static const struct wl_data_offer_listener _offer_listener =
 };
 
 static void
-_ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
-{
-   if (!source) return;
-   source->refcount--;
-   if (source->refcount == 0)
-     {
-        wl_data_offer_destroy(source->offer);
-        wl_array_release(&source->types);
-        free(source);
-     }
-}
-
-static void
 _source_cb_target_free(void *data EINA_UNUSED, void *event)
 {
    Ecore_Wl2_Event_Data_Source_Target *ev;
@@ -410,6 +397,19 @@ _ecore_wl2_dnd_selection(Ecore_Wl2_Input *input, struct 
wl_data_offer *offer)
      }
 }
 
+void
+_ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
+{
+   if (!source) return;
+   source->refcount--;
+   if (source->refcount == 0)
+     {
+        wl_data_offer_destroy(source->offer);
+        wl_array_release(&source->types);
+        free(source);
+     }
+}
+
 EAPI void
 ecore_wl2_dnd_drag_types_set(Ecore_Wl2_Input *input, const char **types)
 {
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c 
b/src/lib/ecore_wl2/ecore_wl2_input.c
index c73908c..1acbf3c 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1268,8 +1268,8 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
      }
 
    if (input->data.source) wl_data_source_destroy(input->data.source);
-   /* TODO: cleanup dnd */
-   /* TODO: cleanup selection */
+   if (input->drag.source) _ecore_wl2_dnd_del(input->drag.source);
+   if (input->selection.source) _ecore_wl2_dnd_del(input->selection.source);
    if (input->data.device) wl_data_device_destroy(input->data.device);
 
    if (input->xkb.state) xkb_state_unref(input->xkb.state);
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h 
b/src/lib/ecore_wl2/ecore_wl2_private.h
index eac52db..ed3f246 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -239,5 +239,6 @@ void _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input);
 void _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, unsigned int 
timestamp);
 void _ecore_wl2_dnd_drop(Ecore_Wl2_Input *input);
 void _ecore_wl2_dnd_selection(Ecore_Wl2_Input *input, struct wl_data_offer 
*offer);
+void _ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source);
 
 #endif

-- 


Reply via email to