diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-06-06 14:42:13 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-06-07 09:39:10 +0200 |
commit | 7e72a9328365fbecc366e75a600d12ef8b8f3c4c (patch) | |
tree | f4827ea72aeaf79e65658f869421bd438f9da5c3 | |
parent | 590b52ce7510a47e0357ebd8f9c5ee79b8ca61e3 (diff) | |
download | efl-7e72a9328365fbecc366e75a600d12ef8b8f3c4c.tar.gz |
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
-rw-r--r-- | src/lib/eo/eo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index fa071d6633..1ba72614f1 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -1912,7 +1912,7 @@ efl_unref(const Eo *obj_id) #ifdef EO_DEBUG _eo_log_obj_ref_op(obj, EO_REF_OP_UNREF); #endif - if (EINA_UNLIKELY((obj->user_refcount <= 0 && !obj->unref_compensate))) + if (EINA_UNLIKELY((obj->user_refcount <= 0))) { if (obj->user_refcount < 0) { |