fix infintie delfn loop waiting to happen.
authorCarsten Haitzler <raster@rasterman.com>
Mon, 3 Dec 2012 11:40:23 +0000 (11:40 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Mon, 3 Dec 2012 11:40:23 +0000 (11:40 +0000)
SVN revision: 80048

src/bin/e_object.c

index 2210dc9..3739100 100644 (file)
@@ -314,18 +314,23 @@ e_object_del_attach_func_set(E_Object *obj, E_Object_Cleanup_Func func)
 EAPI void
 e_object_delfn_clear(E_Object *obj)
 {
+   E_Object_Delfn *dfn;
+   
    E_OBJECT_CHECK(obj);
-   while (obj->del_fn_list)
+   if (obj->walking_list)
      {
-        E_Object_Delfn *dfn = (E_Object_Delfn *)obj->del_fn_list;
-        if (obj->walking_list)
-          dfn->delete_me = 1;
-        else
+        EINA_INLIST_FOREACH(obj->del_fn_list, dfn)
           {
-             obj->del_fn_list = eina_inlist_remove(obj->del_fn_list,
-                                                   EINA_INLIST_GET(dfn));
-             free(dfn);
+             dfn->delete_me = 1;
           }
+        return;
+     }
+   while (obj->del_fn_list)
+     {
+        dfn = (E_Object_Delfn *)obj->del_fn_list;
+        obj->del_fn_list = eina_inlist_remove(obj->del_fn_list,
+                                              EINA_INLIST_GET(dfn));
+        free(dfn);
      }
 }