Revert "ecore timer - fuix up segv storm that has crept in with frees"
authorCedric Bail <cedric@osg.samsung.com>
Fri, 6 May 2016 04:32:37 +0000 (21:32 -0700)
committerCedric Bail <cedric@osg.samsung.com>
Fri, 6 May 2016 04:40:23 +0000 (21:40 -0700)
This reverts commit a13570c17c97bb9407c24bcf78ab28eaa4541ad9.

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.

src/lib/ecore/ecore_timer.c

index 1b69676..54cf773 100644 (file)
@@ -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 (eo_key_data_get(event->obj, "_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);
-          }
+        eo_del(event->obj);
+        free(legacy);
      }
 
    return EO_CALLBACK_CONTINUE;
@@ -225,10 +219,8 @@ ecore_timer_del(Ecore_Timer *timer)
    legacy = eo_key_data_get(timer, "_legacy");
    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);
+   eo_key_del(timer, "_legacy");
    eo_del(timer);
 
    return data;