summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
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 /src/lib/eo/eo.c
parenta16d12799789d6c69288fbafb81bdd04f9a59f21 (diff)
eo: update refcount before sending efl_noref event to avoid double update during events propagation.
Diffstat (limited to 'src/lib/eo/eo.c')
-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 74467dd..32d044e 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1894,8 +1894,10 @@ efl_unref(const Eo *obj_id)
1894 return ; 1894 return ;
1895 } 1895 }
1896 1896
1897 if (EINA_UNLIKELY((obj->user_refcount == 1 && !obj->parent) || 1897 --(obj->user_refcount);
1898 (obj->user_refcount == 2 && obj->parent))) 1898
1899 if (EINA_UNLIKELY((obj->user_refcount == 0 && !obj->parent) ||
1900 (obj->user_refcount == 1 && obj->parent)))
1899 { 1901 {
1900 // The noref event should happen before any object in the 1902 // The noref event should happen before any object in the
1901 // tree get affected by the change in refcount. 1903 // tree get affected by the change in refcount.
@@ -1903,7 +1905,6 @@ efl_unref(const Eo *obj_id)
1903 efl_noref((Eo *) obj_id); 1905 efl_noref((Eo *) obj_id);
1904 } 1906 }
1905 1907
1906 --(obj->user_refcount);
1907#ifdef EO_DEBUG 1908#ifdef EO_DEBUG
1908 _eo_log_obj_ref_op(obj, EO_REF_OP_UNREF); 1909 _eo_log_obj_ref_op(obj, EO_REF_OP_UNREF);
1909#endif 1910#endif