summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2016-11-21 13:06:19 -0800
committerCedric Bail <cedric@osg.samsung.com>2016-11-21 16:03:27 -0800
commitf511c64269a351943c8296108185744c7ebd3320 (patch)
treee5517ef171418a3b3c57d3a3675aeef620c5c661
parentf2fa8f67f5f13144fee961b03dcd8b9c5b99f00b (diff)
eo: refactor callback delayed cleaning code.
-rw-r--r--src/lib/eo/eo_base_class.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 5dbaf9a9ac..ea22bb3ef0 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1146,6 +1146,20 @@ err:
1146 return EINA_FALSE; 1146 return EINA_FALSE;
1147} 1147}
1148 1148
1149static void
1150_efl_object_event_callback_clean(Eo *obj, Efl_Object_Data *pd,
1151 const Efl_Callback_Array_Item *array,
1152 Eo_Callback_Description **cb)
1153{
1154 (*cb)->delete_me = EINA_TRUE;
1155 if (pd->walking_list > 0)
1156 pd->deletions_waiting = EINA_TRUE;
1157 else
1158 _eo_callback_remove(pd, cb);
1159
1160 efl_event_callback_call(obj, EFL_EVENT_CALLBACK_DEL, (void *)array);
1161}
1162
1149EOLIAN static Eina_Bool 1163EOLIAN static Eina_Bool
1150_efl_object_event_callback_del(Eo *obj, Efl_Object_Data *pd, 1164_efl_object_event_callback_del(Eo *obj, Efl_Object_Data *pd,
1151 const Efl_Event_Description *desc, 1165 const Efl_Event_Description *desc,
@@ -1166,13 +1180,7 @@ _efl_object_event_callback_del(Eo *obj, Efl_Object_Data *pd,
1166 { 1180 {
1167 const Efl_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}}; 1181 const Efl_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}};
1168 1182
1169 (*cb)->delete_me = EINA_TRUE; 1183 _efl_object_event_callback_clean(obj, pd, arr, cb);
1170 if (pd->walking_list > 0)
1171 pd->deletions_waiting = EINA_TRUE;
1172 else
1173 _eo_callback_remove(pd, cb);
1174
1175 efl_event_callback_call(obj, EFL_EVENT_CALLBACK_DEL, (void *)arr);
1176 return EINA_TRUE; 1184 return EINA_TRUE;
1177 } 1185 }
1178 } 1186 }
@@ -1246,13 +1254,7 @@ _efl_object_event_callback_array_del(Eo *obj, Efl_Object_Data *pd,
1246 ((*cb)->items.item_array == array) && 1254 ((*cb)->items.item_array == array) &&
1247 ((*cb)->func_data == user_data)) 1255 ((*cb)->func_data == user_data))
1248 { 1256 {
1249 (*cb)->delete_me = EINA_TRUE; 1257 _efl_object_event_callback_clean(obj, pd, array, cb);
1250 if (pd->walking_list > 0)
1251 pd->deletions_waiting = EINA_TRUE;
1252 else
1253 _eo_callback_remove(pd, cb);
1254
1255 efl_event_callback_call(obj, EFL_EVENT_CALLBACK_DEL, (void *)array);
1256 return EINA_TRUE; 1258 return EINA_TRUE;
1257 } 1259 }
1258 } 1260 }