tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8bba92fbca7c721a7582b098698404e491f44941

commit 8bba92fbca7c721a7582b098698404e491f44941
Author: Tom Hacohen <[email protected]>
Date:   Tue Nov 26 12:16:22 2013 +0000

    Evas object: Set manual_free to false once obj is detached from canvas.
    
    This means unref will really free the object instead of just let it
    linger in memory once the object is unrefed.
    This is also correct because once detached from the canvas, Evas has
    nothing to do with the object and it shouldn't need the manual free
    anymore.
---
 src/lib/evas/canvas/evas_object_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index 233bd41..24386af 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -196,7 +196,11 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
    eina_cow_free(evas_object_state_cow, (const Eina_Cow_Data**) &obj->prev);
    eo_data_unref(eo_obj, obj->private_data);
    obj->private_data = NULL;
-   eo_manual_free(eo_obj);
+
+   /* Try to manual free, and if it fails, unset it so the next unref will
+    * actually free the object. */
+   if (!eo_manual_free(eo_obj))
+      eo_manual_free_set(eo_obj, EINA_FALSE);
 }
 
 void

-- 


Reply via email to