jackdanielz pushed a commit to branch master.

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

commit f25823aa4be7e2f3ddbddba006a90bdd68b3f173
Author: Thiep Ha <thie...@gmail.com>
Date:   Thu Jun 25 08:54:36 2015 +0300

    cnp: remove loss callback when object is deleted
    
    Summary:
    SEG_FAULT happens when the object which has selection is deleted,
    and new selection is done at another object.
    Reason: loss_cb is not removed when the object which has selection is 
deleted.
    When new selection is set for new object, the loss_cb is called for deleted
    object. As result, SEG_FAULT happens.
    
    Test Plan:
    Run elementary test, open Entry, do selection,
    close Entry window, open Entry one more time, do selection.
    
    Reviewers: JackDanielZ
    
    Differential Revision: https://phab.enlightenment.org/D2763
---
 src/lib/elm_cnp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 0bee00a..301994d 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -669,7 +669,12 @@ static void
 _x11_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void 
*event_info EINA_UNUSED)
 {
    X11_Cnp_Selection *sel = data;
-   if (sel->widget == obj) sel->widget = NULL;
+   if (sel->widget == obj)
+     {
+        sel->loss_cb = NULL;
+        sel->loss_data = NULL;
+        sel->widget = NULL;
+     }
    if (dragwidget == obj) dragwidget = NULL;
 }
 

-- 


Reply via email to