edje: add more protection during edje_emit.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 9 May 2012 10:44:02 +0000 (10:44 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 9 May 2012 10:44:02 +0000 (10:44 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@70894 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_cache.c

index ab64dcf..14a3155 100644 (file)
@@ -135,11 +135,21 @@ _edje_file_warn(void *data)
    Eina_List *l, *ll;
    Edje *ed;
 
-   EINA_LIST_FOREACH_SAFE(edf->edjes, l, ll, ed)
+   edf->references++;
+
+   EINA_LIST_FOREACH(edf->edjes, l, ed)
+     _edje_ref(ed);
+
+   EINA_LIST_FOREACH(edf->edjes, l, ed)
      {
         _edje_emit(ed, "edje,change,file", "edje");
      }
 
+   EINA_LIST_FOREACH_SAFE(edf->edjes, l, ll, ed)
+     _edje_unref(ed);
+
+   edf->references--;
+
    edf->timeout = NULL;
    return EINA_FALSE;
 }