From 5856507af5e412c319a6f3bde3b5cd6315b6e301 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Thu, 22 Dec 2016 14:10:04 +0900 Subject: [PATCH] evas_events: add NULL check logic to source mouse event. 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 Change-Id: Iaf0b6d8c519c4c478c2b16b923066c59ba69f7e2 --- src/lib/evas/canvas/evas_events.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 280a3d4bf6..b668222d10 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -363,6 +363,10 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event { child = eo_data_scope_get(eo_child, EVAS_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; if ((evas_object_clippers_is_visible(eo_child, child) || child->mouse_grabbed) && (!evas_event_passes_through(eo_child, child)) && @@ -424,6 +428,10 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event EINA_LIST_FOREACH(copy, l, eo_child) { child = eo_data_scope_get(eo_child, EVAS_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; ev->cur.canvas = point; @@ -602,6 +610,10 @@ _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mous { if (src->delete_me) return; child = eo_data_scope_get(eo_child, EVAS_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; ev->canvas = point; _evas_event_havemap_adjust(eo_child, child, &ev->canvas.x, -- 2.34.1