|author||Tom Hacohen <firstname.lastname@example.org>||2016-06-01 13:14:30 +0100|
|committer||Tom Hacohen <email@example.com>||2016-06-01 13:33:21 +0100|
Revert "Eo: Remove eo_del() and make eo_unref() the replacement."
This reverts commit 546ff7bbba788ec834c5608361c0834853f2d5d7. It seems that eo_del() is useful and removing it was creating bugs. The issue is that the way we defined parents in eo, both the parent and the programmer share a reference to the object. When we eo_unref() that reference as the programmer, eo has no way to know it's this specific reference we are freeing, and not a general one, so in some circumstances, for example: eo_ref(child); eo_unref(child); // trying to delete here eo_unref(container); // container is deleted here eo_unref(child); // child already has 0 refs before this point. We would have an issue with references and objects being freed too soon and in general, issue with the references. Having eo_del() solves that, because this one explicitly unparents if there is a parent, meaning the reference ownership is explicitly taken by the programmer. eo_del() is essentially a convenience function around "check if has parent, and if so unparent, otherwise, unref". Which should be used when you want to delete an object although it has a parent, and is equivalent to eo_unref() when it doesn't have one.
Diffstat (limited to 'src/tests/evas/evas_test_image.c')
1 files changed, 3 insertions, 3 deletions
|@@ -638,16 +638,16 @@ START_TEST(evas_object_image_defaults)|
|639||evas_object_image_fill_get(o, &x, &y, &w, &h);||639||evas_object_image_fill_get(o, &x, &y, &w, &h);|
|640||fail_if(x || y || w || h);||640||fail_if(x || y || w || h);|
|643||o = evas_object_image_filled_add(e);||643||o = evas_object_image_filled_add(e);|
|647||/* test eo defaults */||647||/* test eo defaults */|
|648||o = eo_add(EVAS_IMAGE_CLASS, e);||648||o = eo_add(EVAS_IMAGE_CLASS, e);|