From 3b175fd7e9e3e251d1f53909aa6a32e8e3a54461 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Fri, 26 Aug 2016 17:09:38 +0900 Subject: [PATCH] elm: Fix some ERR messages following previous patch This simply avoids calling functions on NULL objects, since the previous patch would ERR out rather than silently ignore the problem. I just add explicit NULL checks before calling the functions, so it's clear the object could be NULL (in the widget). --- src/lib/elementary/efl_ui_win.c | 9 ++++++--- src/lib/elementary/elm_gengrid.c | 3 ++- src/lib/elementary/elm_genlist.c | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index aced7ba..1177bec 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1102,9 +1102,12 @@ the_end: _elm_win_focus_highlight_visible_set(sd, common_visible); sd->focus_highlight.geometry_changed = EINA_FALSE; sd->focus_highlight.prev = sd->focus_highlight.cur; - evas_object_event_callback_add - (sd->focus_highlight.prev.target, - EVAS_CALLBACK_DEL, _elm_win_focus_prev_target_del, data); + if (sd->focus_highlight.prev.target) + { + evas_object_event_callback_add + (sd->focus_highlight.prev.target, + EVAS_CALLBACK_DEL, _elm_win_focus_prev_target_del, data); + } } static void diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index 44a092c..b0b6214 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -4116,7 +4116,8 @@ _internal_elm_gengrid_clear(Evas_Object *obj, if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next); if (itn) itn->walking++; /* prevent early death of subitem */ - _item_mouse_callbacks_del(it, VIEW(it)); + if (VIEW(it)) + _item_mouse_callbacks_del(it, VIEW(it)); it->del_cb(it); efl_del(EO_OBJ(it)); if (itn) itn->walking--; diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index a00852e..3e5abf8 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -1523,6 +1523,7 @@ _item_cache_free(Item_Cache *itc) static void _item_cache_clean(Elm_Genlist_Data *sd) { + if (!sd->obj) return; evas_event_freeze(evas_object_evas_get(sd->obj)); while ((sd->item_cache) && (sd->item_cache_count > sd->item_cache_max)) -- 2.7.4