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
This commit is contained in:
Hosang Kim 2017-01-02 15:17:40 +09:00 committed by Jean-Philippe Andre
parent b1f1cd14c2
commit fc05adbb47
1 changed files with 14 additions and 0 deletions

View File

@ -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)
{