elm : move unrealize callback call before the content caching.
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Mon, 24 Feb 2020 13:52:09 +0000 (08:52 -0500)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 3 Mar 2020 21:14:37 +0000 (06:14 +0900)
Summary:
item edje and contents are cached for performance improvement in genlist & gengrid.
but to provide elm_genlist(gengrid)_all_contents_unset method before the contents
are being cached, unrealize callback must be come before the unrealize process.

currently,
item_unrealize
1.unrealize process
2.contents cached
3.unrealize callback
4.all_contents_unset : nothing to unset in the item.

by this patch,
item_unrealize
1.unrealize callback
2.all_contents_unset : contents are unset.
3.unrealize process
4.contents(null) cached

Reviewers: bu5hm4n, cedric, eagleeye, zmike

Reviewed By: zmike

Subscribers: zmike, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11402

src/lib/elementary/elm_gengrid.c
src/lib/elementary/elm_genlist.c

index e936e28..1357386 100755 (executable)
@@ -1369,12 +1369,13 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it,
    ELM_SAFE_FREE(it->states, elm_widget_stringlist_free);
    elm_wdg_item_track_cancel(EO_OBJ(it));
 
+   if (!calc)
+     efl_event_callback_legacy_call(WIDGET(it), ELM_GENGRID_EVENT_UNREALIZED, EO_OBJ(it));
+
    it->unrealize_cb(it);
 
    it->realized = EINA_FALSE;
    it->want_unrealize = EINA_FALSE;
-   if (!calc)
-     efl_event_callback_legacy_call(WIDGET(it), ELM_GENGRID_EVENT_UNREALIZED, EO_OBJ(it));
 
    {
       ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
index fda66dc..023ed9c 100644 (file)
@@ -784,10 +784,11 @@ _elm_genlist_item_unrealize(Elm_Gen_Item *it,
 
    elm_wdg_item_track_cancel(EO_OBJ(it));
 
-   _item_unrealize(it);
    if (!calc)
      efl_event_callback_legacy_call(WIDGET(it), ELM_GENLIST_EVENT_UNREALIZED, EO_OBJ(it));
 
+   _item_unrealize(it);
+
    evas_event_thaw(e);
    evas_event_thaw_eval(e);
 }