forked from enlightenment/efl
Revert "ecore timer - fuix up segv storm that has crept in with frees"
This reverts commit a13570c17c
.
This doesn't really fix the problem which is hidden by eo capability to not
crash on bad unref. With legacy API you are allowed to do a ecore_timer_del
and also return EINA_FALSE. In that case you have a double eo_del (which is
luckily protected) and a double free (that is not). It does crash on the
double free, but the issue is a lifecycle issue. Will bring a better patch
for this.
This commit is contained in:
parent
a13570c17c
commit
bfc19893d7
|
@ -157,14 +157,8 @@ _ecore_timer_legacy_tick(void *data, const Eo_Event *event)
|
||||||
|
|
||||||
if (!_ecore_call_task_cb(legacy->func, (void*)legacy->data))
|
if (!_ecore_call_task_cb(legacy->func, (void*)legacy->data))
|
||||||
{
|
{
|
||||||
if (eo_key_data_get(event->obj, "_legacy"))
|
eo_del(event->obj);
|
||||||
{
|
free(legacy);
|
||||||
eo_key_del(event->obj, "_legacy");
|
|
||||||
eo_event_callback_del(event->obj, EFL_TIMER_EVENT_TICK,
|
|
||||||
_ecore_timer_legacy_tick, legacy),
|
|
||||||
free(legacy);
|
|
||||||
eo_del(event->obj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EO_CALLBACK_CONTINUE;
|
return EO_CALLBACK_CONTINUE;
|
||||||
|
@ -225,10 +219,8 @@ ecore_timer_del(Ecore_Timer *timer)
|
||||||
legacy = eo_key_data_get(timer, "_legacy");
|
legacy = eo_key_data_get(timer, "_legacy");
|
||||||
data = (void*) legacy->data;
|
data = (void*) legacy->data;
|
||||||
|
|
||||||
eo_key_del(timer, "_legacy");
|
|
||||||
eo_event_callback_del(timer, EFL_TIMER_EVENT_TICK,
|
|
||||||
_ecore_timer_legacy_tick, legacy),
|
|
||||||
free(legacy);
|
free(legacy);
|
||||||
|
eo_key_del(timer, "_legacy");
|
||||||
eo_del(timer);
|
eo_del(timer);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
|
Loading…
Reference in New Issue