From fc05adbb478b6d0738014027e1273cbce4ea9fae Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Mon, 2 Jan 2017 15:17:40 +0900 Subject: [PATCH] evas_events: add checking NULL logic to source mouse event. Summary: When the proxy's source is updated, the proxy's event list will be updated, too. But there is no way now. So add defensive code for protecting segment fault. @fix Reviewers: woohyun, raster, jpeg Reviewed By: jpeg Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D4508 --- src/lib/evas/canvas/evas_events.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 5dc31a3..d01dfec 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -527,6 +527,11 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, EINA_LIST_FOREACH(copy, l, eo_child) { child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS); + //FIXME: When object is deleted in the src_event_in list, + //the src_event_in list should be updated. But now there is no way. + //So add checking NULL logic, please delete it if you make a better way. + if (!child) continue; + obj_pdata = _evas_object_pointer_data_get(pdata, child); if (!obj_pdata) { @@ -602,6 +607,10 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, EINA_LIST_FOREACH(copy, l, eo_child) { child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS); + //FIXME: When object is deleted in the src_event_in list, + //the src_event_in list should be updated. But now there is no way. + //So add checking NULL logic, please delete it if you make a better way. + if (!child) continue; obj_pdata = _evas_object_pointer_data_get(pdata, child); if (!obj_pdata) @@ -815,6 +824,11 @@ _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, if (src->delete_me) return; child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS); + //FIXME: When object is deleted in the src_event_in list, + //the src_event_in list should be updated. But now there is no way. + //So add checking NULL logic, please delete it if you make a better way. + if (!child) continue; + obj_pdata = _evas_object_pointer_data_get(pdata, child); if (!obj_pdata) { -- 2.7.4