summaryrefslogtreecommitdiff
path: root/src/tests/edje/edje_test_edje.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-06-01 13:14:30 +0100
committerTom Hacohen <tom@stosb.com>2016-06-01 13:33:21 +0100
commita6a23389625a5c65747bc648424db18173f563b9 (patch)
treef0c13bdb49c9211a90b9d2a034c2a4333b38af3e /src/tests/edje/edje_test_edje.c
parent466d9fbaf1319db4df9d576bdbe196f2557f6627 (diff)
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/edje/edje_test_edje.c')
-rw-r--r--src/tests/edje/edje_test_edje.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 2b2b47a594..2de5f147b7 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -705,7 +705,7 @@ START_TEST(edje_test_table_eoapi)
705 fail_if(!efl_pack_clear(proxy)); 705 fail_if(!efl_pack_clear(proxy));
706 fail_if(efl_content_count(efl_part(obj, "table2")) != 1); 706 fail_if(efl_content_count(efl_part(obj, "table2")) != 1);
707 fail_if(efl_content_count(proxy) != 4); 707 fail_if(efl_content_count(proxy) != 4);
708 eo_unref(proxy); 708 eo_del(proxy);
709 709
710 EDJE_TEST_FREE_EVAS(); 710 EDJE_TEST_FREE_EVAS();
711} 711}