summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-06-06 14:42:13 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-06-07 09:39:10 +0200
commit7e72a9328365fbecc366e75a600d12ef8b8f3c4c (patch)
treef4827ea72aeaf79e65658f869421bd438f9da5c3 /src/lib/eo/eo.c
parent590b52ce7510a47e0357ebd8f9c5ee79b8ca61e3 (diff)
eo: unref compensate is not requires here
this check caused a leaked reference. Eo objects are having two reference counters a internal and external one. The external one can be manipulated via efl_ref / efl_unref. The internal one can be manipulated via _efl_ref _efl_unref. The external reference counter is keeping a internal reference by the time the external counter is > 0. When the external counter reaches == 0 this internal reference is given up with the _efl_unref call in eo.c:1928. However, checking unref_compensate in the block in line 1950 leads that to the leak that this internal reference is not given up at the pointer user_refcount reaches exactly 0. This check also does not prevent anything, the object is kept alive anywayys as the efl_unref method keeps its private internal reference. This lead to leaks in efl_device_* classes, parts have not been destructed correctly. Differential Revision: https://phab.enlightenment.org/D6252
Diffstat (limited to 'src/lib/eo/eo.c')
-rw-r--r--src/lib/eo/eo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index fa071d6..1ba7261 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1912,7 +1912,7 @@ efl_unref(const Eo *obj_id)
1912#ifdef EO_DEBUG 1912#ifdef EO_DEBUG
1913 _eo_log_obj_ref_op(obj, EO_REF_OP_UNREF); 1913 _eo_log_obj_ref_op(obj, EO_REF_OP_UNREF);
1914#endif 1914#endif
1915 if (EINA_UNLIKELY((obj->user_refcount <= 0 && !obj->unref_compensate))) 1915 if (EINA_UNLIKELY((obj->user_refcount <= 0)))
1916 { 1916 {
1917 if (obj->user_refcount < 0) 1917 if (obj->user_refcount < 0)
1918 { 1918 {