summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo_base_class.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eo/eo_base_class.c')
-rw-r--r--src/lib/eo/eo_base_class.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 8d147d3152..d10bf287bd 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -72,7 +72,7 @@ struct _Efl_Object_Data
72 EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_NOREF); 72 EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_NOREF);
73 73
74 EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_INVALIDATE); 74 EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_INVALIDATE);
75 Eina_Bool has_destroyed_event_cb : 1; // No proper count: minor optimization triggered at destruction only 75 EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_DESTRUCT); // No proper count: minor optimization triggered at destruction only
76 Eina_Bool callback_stopped : 1; 76 Eina_Bool callback_stopped : 1;
77 Eina_Bool need_cleaning : 1; 77 Eina_Bool need_cleaning : 1;
78 78
@@ -1269,6 +1269,7 @@ _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const Efl_Callback_Arr
1269 else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_DEL) 1269 else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_DEL)
1270 else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DEL) 1270 else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DEL)
1271 else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_INVALIDATE) 1271 else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_INVALIDATE)
1272 else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DESTRUCT)
1272 else if (it->desc == EFL_EVENT_NOREF && !pd->event_cb_EFL_EVENT_NOREF) 1273 else if (it->desc == EFL_EVENT_NOREF && !pd->event_cb_EFL_EVENT_NOREF)
1273 { 1274 {
1274 if (efl_event_callback_count(obj_id, EFL_EVENT_NOREF) > 0) 1275 if (efl_event_callback_count(obj_id, EFL_EVENT_NOREF) > 0)
@@ -1280,8 +1281,6 @@ _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const Efl_Callback_Arr
1280 pd->event_cb_EFL_EVENT_NOREF = EINA_TRUE; 1281 pd->event_cb_EFL_EVENT_NOREF = EINA_TRUE;
1281 } 1282 }
1282 } 1283 }
1283 else if (it->desc == EFL_EVENT_DESTRUCT)
1284 pd->has_destroyed_event_cb = EINA_TRUE;
1285 else if (it->desc == EFL_EVENT_OWNERSHIP_SHARED || it->desc == EFL_EVENT_OWNERSHIP_UNIQUE) 1284 else if (it->desc == EFL_EVENT_OWNERSHIP_SHARED || it->desc == EFL_EVENT_OWNERSHIP_UNIQUE)
1286 { 1285 {
1287 EO_OBJ_POINTER_RETURN(obj_id, obj); 1286 EO_OBJ_POINTER_RETURN(obj_id, obj);
@@ -1353,7 +1352,7 @@ _eo_callback_remove_all(Efl_Object_Data *pd)
1353 eina_freeq_ptr_main_add(pd->callbacks, free, 0); 1352 eina_freeq_ptr_main_add(pd->callbacks, free, 0);
1354 pd->callbacks = NULL; 1353 pd->callbacks = NULL;
1355 pd->callbacks_count = 0; 1354 pd->callbacks_count = 0;
1356 pd->has_destroyed_event_cb = EINA_FALSE; 1355 pd->event_cb_EFL_EVENT_DESTRUCT = EINA_FALSE;
1357 pd->event_cb_EFL_EVENT_CALLBACK_ADD = EINA_FALSE; 1356 pd->event_cb_EFL_EVENT_CALLBACK_ADD = EINA_FALSE;
1358 pd->event_cb_EFL_EVENT_CALLBACK_DEL = EINA_FALSE; 1357 pd->event_cb_EFL_EVENT_CALLBACK_DEL = EINA_FALSE;
1359 pd->event_cb_EFL_EVENT_DEL = EINA_FALSE; 1358 pd->event_cb_EFL_EVENT_DEL = EINA_FALSE;
@@ -2005,6 +2004,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
2005 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DEL) 2004 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DEL)
2006 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_INVALIDATE) 2005 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_INVALIDATE)
2007 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_NOREF) 2006 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_NOREF)
2007 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DESTRUCT)
2008 2008
2009 if (!legacy_compare) 2009 if (!legacy_compare)
2010 { 2010 {
@@ -2585,7 +2585,7 @@ err_parent_back:
2585 // this isn't 100% correct, as the object is still "slightly" alive at this 2585 // this isn't 100% correct, as the object is still "slightly" alive at this
2586 // point (so efl_destructed_is() returns false), but triggering the 2586 // point (so efl_destructed_is() returns false), but triggering the
2587 // "destruct" event here is the simplest, safest solution. 2587 // "destruct" event here is the simplest, safest solution.
2588 if (EINA_UNLIKELY(pd->has_destroyed_event_cb)) 2588 if (EINA_UNLIKELY(pd->event_cb_EFL_EVENT_DESTRUCT))
2589 _event_callback_call(obj, pd, EFL_EVENT_DESTRUCT, NULL, EINA_FALSE); 2589 _event_callback_call(obj, pd, EFL_EVENT_DESTRUCT, NULL, EINA_FALSE);
2590 2590
2591 // remove generic data after this final event, in case they are used in a cb 2591 // remove generic data after this final event, in case they are used in a cb