discomfitor pushed a commit to branch master.

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

commit f9bd731087c7da7d2d1712baaf2c29aeeff03011
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Aug 7 12:49:12 2015 -0400

    track xwl dnd event handlers
---
 src/modules/xwayland/dnd.c        | 12 ++++++++++--
 src/modules/xwayland/e_mod_main.c |  2 ++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/modules/xwayland/dnd.c b/src/modules/xwayland/dnd.c
index 69ae9b5..73636d7 100644
--- a/src/modules/xwayland/dnd.c
+++ b/src/modules/xwayland/dnd.c
@@ -10,6 +10,8 @@ static Ecore_X_Atom xwl_dnd_atom;
 
 static int32_t cur_fd = -1;
 
+static Eina_List *handlers;
+
 static void
 _xdnd_finish(Eina_Bool success)
 {
@@ -193,10 +195,16 @@ dnd_init(void)
 {
    ecore_x_fixes_selection_notification_request(ecore_x_atom_get("CLIPBOARD"));
    ecore_x_fixes_selection_notification_request(ECORE_X_ATOM_SELECTION_XDND);
-   ecore_event_handler_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, 
(Ecore_Event_Handler_Cb)_xwl_fixes_selection_notify, NULL);
-   ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, 
(Ecore_Event_Handler_Cb)_xwl_selection_notify, NULL);
+   E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, 
_xwl_fixes_selection_notify, NULL);
+   E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_SELECTION_NOTIFY, 
_xwl_selection_notify, NULL);
    xconvertselection = dlsym(NULL, "XConvertSelection");
    string_atom = ecore_x_atom_get("UTF8_STRING");
    xwl_dnd_atom = ecore_x_atom_get("E_XWL_DND_ATOM_HAHA");
    e_comp_shape_queue();
 }
+
+EINTERN void
+dnd_shutdown(void)
+{
+   E_FREE_LIST(handlers, ecore_event_handler_del);
+}
diff --git a/src/modules/xwayland/e_mod_main.c 
b/src/modules/xwayland/e_mod_main.c
index 8cacc27..7bb78c1 100644
--- a/src/modules/xwayland/e_mod_main.c
+++ b/src/modules/xwayland/e_mod_main.c
@@ -4,6 +4,7 @@
 #include <sys/un.h>
 
 EINTERN void dnd_init(void);
+EINTERN void dnd_shutdown(void);
 
 /* local structures */
 typedef struct _E_XWayland_Server E_XWayland_Server;
@@ -407,6 +408,7 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
    char path[256];
 
    if (!exs) return 1;
+   dnd_shutdown();
 
    unlink(exs->lock);
 

-- 


Reply via email to