summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-04-02 17:18:46 -0700
committerCedric Bail <cedric@osg.samsung.com>2018-04-02 17:18:46 -0700
commit224049fa18bc84d375df3be93435fb1235990c13 (patch)
treef2833bfea6ba03758a0abffdcdef343dde3ef2a4 /src/lib/eo/eo.c
parent1ca196fbcd5aea30cf1d97190c7525262e9e4664 (diff)
eo: trigger invalidate and noref event before any modification is commited on the object tree.
Diffstat (limited to 'src/lib/eo/eo.c')
-rw-r--r--src/lib/eo/eo.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 0fb5891..479938a 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1882,6 +1882,14 @@ efl_unref(const Eo *obj_id)
1882{ 1882{
1883 EO_OBJ_POINTER_RETURN(obj_id, obj); 1883 EO_OBJ_POINTER_RETURN(obj_id, obj);
1884 1884
1885 if (EINA_UNLIKELY(obj->user_refcount == 1))
1886 {
1887 // The noref event should happen before any object in the
1888 // tree get affected by the change in refcount.
1889 efl_event_callback_call((Eo *) obj_id, EFL_EVENT_NOREF, NULL);
1890 efl_noref((Eo *) obj_id);
1891 }
1892
1885 --(obj->user_refcount); 1893 --(obj->user_refcount);
1886#ifdef EO_DEBUG 1894#ifdef EO_DEBUG
1887 _eo_log_obj_ref_op(obj, EO_REF_OP_UNREF); 1895 _eo_log_obj_ref_op(obj, EO_REF_OP_UNREF);
@@ -1896,7 +1904,6 @@ efl_unref(const Eo *obj_id)
1896 EO_OBJ_DONE(obj_id); 1904 EO_OBJ_DONE(obj_id);
1897 return; 1905 return;
1898 } 1906 }
1899 efl_noref((Eo *) obj_id);
1900 _efl_unref(obj); 1907 _efl_unref(obj);
1901 } 1908 }
1902 EO_OBJ_DONE(obj_id); 1909 EO_OBJ_DONE(obj_id);