discomfitor pushed a commit to branch master.

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

commit 9df31011c8bed28f9b0dd0fe1b1ea16abe743b8e
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri May 12 12:09:18 2017 -0400

    unset wl selection target client if that client is deleted
    
    the frame deletion callback would trigger far too late, allowing
    crashes to occur if the selection target client exited between the
    time of the drop event and the selection send event
---
 src/bin/e_comp_wl.c      |  1 +
 src/bin/e_comp_wl_data.c | 13 -------------
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index b5cd203..f3bd8e8 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -2493,6 +2493,7 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client 
*ec)
         ec->parent->lock_close = EINA_FALSE;
         ec->parent->modal = NULL;
      }
+   if (e_comp_wl->selection.target == ec) e_comp_wl->selection.target = NULL;
 
    if ((ec == e_client_focused_get()) && ec->visible) 
_e_comp_wl_keyboard_leave(ec);
 
diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c
index 53dc07b..6de53c7 100644
--- a/src/bin/e_comp_wl_data.c
+++ b/src/bin/e_comp_wl_data.c
@@ -938,15 +938,6 @@ _e_comp_wl_clipboard_create(void)
    wl_signal_add(&e_comp_wl->selection.signal, &e_comp_wl->clipboard.listener);
 }
 
-static void
-_e_comp_wl_data_device_target_del(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj EINA_UNUSED, void *event_info EINA_UNUSED)
-{
-   E_Client *ec = data;
-
-   if (e_comp_wl->selection.target == ec)
-     e_comp_wl->selection.target = NULL;
-}
-
 E_API void
 e_comp_wl_data_device_send_enter(E_Client *ec)
 {
@@ -974,8 +965,6 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
           }
      }
    e_comp_wl->selection.target = ec;
-   evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL,
-                                  _e_comp_wl_data_device_target_del, ec);
 
 #ifndef HAVE_WAYLAND_ONLY
    if (e_client_has_xwindow(ec))
@@ -1034,8 +1023,6 @@ e_comp_wl_data_device_send_leave(E_Client *ec)
        e_client_has_xwindow(e_comp_wl->drag_client))
      return;
    if (e_comp_wl->drag && (e_comp_wl->drag->object == ec->frame)) return;
-   evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL,
-                                       _e_comp_wl_data_device_target_del, ec);
    if (e_comp_wl->selection.target == ec)
      e_comp_wl->selection.target = NULL;
 #ifndef HAVE_WAYLAND_ONLY

-- 


Reply via email to