elm: Fix some ERR messages following previous patch
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 26 Aug 2016 08:09:38 +0000 (17:09 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 26 Aug 2016 08:15:05 +0000 (17:15 +0900)
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
src/lib/elementary/elm_gengrid.c
src/lib/elementary/elm_genlist.c

index aced7ba..1177bec 100644 (file)
@@ -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
index 44a092c..b0b6214 100644 (file)
@@ -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--;
index a00852e..3e5abf8 100644 (file)
@@ -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))