summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-05-12 22:09:37 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:19 -0700
commit48b8118123aefe69ecb2d93f0787dd7a021814ad (patch)
treefea1dac51076e2115cd229d10280c4778e7113dd
parenta16d12799789d6c69288fbafb81bdd04f9a59f21 (diff)
downloadefl-48b8118123aefe69ecb2d93f0787dd7a021814ad.tar.gz
eo: update refcount before sending efl_noref event to avoid double update during events propagation.
-rw-r--r--src/lib/eo/eo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 74467ddebc..32d044ebeb 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1894,8 +1894,10 @@ efl_unref(const Eo *obj_id)
return ;
}
- if (EINA_UNLIKELY((obj->user_refcount == 1 && !obj->parent) ||
- (obj->user_refcount == 2 && obj->parent)))
+ --(obj->user_refcount);
+
+ if (EINA_UNLIKELY((obj->user_refcount == 0 && !obj->parent) ||
+ (obj->user_refcount == 1 && obj->parent)))
{
// The noref event should happen before any object in the
// tree get affected by the change in refcount.
@@ -1903,7 +1905,6 @@ efl_unref(const Eo *obj_id)
efl_noref((Eo *) obj_id);
}
- --(obj->user_refcount);
#ifdef EO_DEBUG
_eo_log_obj_ref_op(obj, EO_REF_OP_UNREF);
#endif