forked from enlightenment/efl
elm: Fix cnp crash on WL
See D4144. Original author: @slotus.lee 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. This issue was also happened in X11 (https://phab.enlightenment.org/D2763) Test plan: (on wayland environment) Run elementary test, open Entry, do selection, close Entry window, open Entry one more time, do selection.
This commit is contained in:
parent
86dc7e0c87
commit
85d45ee9b1
|
@ -2820,7 +2820,12 @@ static void
|
||||||
_wl_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
_wl_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Wl_Cnp_Selection *sel = data;
|
Wl_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;
|
if (dragwidget == obj) dragwidget = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue