elc_naviframe: Fix to handle item deletion right after item push 68/143468/1
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 9 Aug 2017 14:32:35 +0000 (23:32 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 10 Aug 2017 05:12:45 +0000 (14:12 +0900)
If an item is deleted right after the item is newly pushed, the push
transition should not happen for both the new item and the current item.

Change-Id: Iba5b9547aae8b3916e76d9e7af3e9250229c563b

src/lib/elc_naviframe.c

index ecb653ce9dcd9b984ff5b3833922f0136dbca6a4..ea31f397708f5d8211fe34bbe16ae711d1488592 100644 (file)
@@ -686,8 +686,16 @@ end:
    // make sure there is no more reference to this item.
    EINA_LIST_FOREACH(sd->ops, l, nfo)
      {
-        if (nfo->related == nit) nfo->related = NULL;
-        if (nfo->self == nit) nfo->self = NULL;
+        /* If an transition is cancelled by deleting an item, then the pair
+         * transition also should be cancelled.
+         * This case can happen when an item is deleted by elm_object_item_del()
+         * right after the item is newly pushed.
+         */
+        if ((nfo->self == nit) || (nfo->related == nit))
+          {
+             nfo->self = NULL;
+             nfo->related = NULL;
+          }
      }
 
    _item_free(nit);