summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2016-05-05 21:32:37 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-05-05 21:40:23 -0700
commitbfc19893d73d5ca8baf2e9df35183b6852d9e9e0 (patch)
tree28597ab0bb2525ee1f463288e2ffa1e2f38c0cea /src
parenta13570c17c97bb9407c24bcf78ab28eaa4541ad9 (diff)
Revert "ecore timer - fuix up segv storm that has crept in with frees"
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore/ecore_timer.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c
index 1b69676e54..54cf773149 100644
--- a/src/lib/ecore/ecore_timer.c
+++ b/src/lib/ecore/ecore_timer.c
@@ -157,14 +157,8 @@ _ecore_timer_legacy_tick(void *data, const Eo_Event *event)
157 157
158 if (!_ecore_call_task_cb(legacy->func, (void*)legacy->data)) 158 if (!_ecore_call_task_cb(legacy->func, (void*)legacy->data))
159 { 159 {
160 if (eo_key_data_get(event->obj, "_legacy")) 160 eo_del(event->obj);
161 { 161 free(legacy);
162 eo_key_del(event->obj, "_legacy");
163 eo_event_callback_del(event->obj, EFL_TIMER_EVENT_TICK,
164 _ecore_timer_legacy_tick, legacy),
165 free(legacy);
166 eo_del(event->obj);
167 }
168 } 162 }
169 163
170 return EO_CALLBACK_CONTINUE; 164 return EO_CALLBACK_CONTINUE;
@@ -225,10 +219,8 @@ ecore_timer_del(Ecore_Timer *timer)
225 legacy = eo_key_data_get(timer, "_legacy"); 219 legacy = eo_key_data_get(timer, "_legacy");
226 data = (void*) legacy->data; 220 data = (void*) legacy->data;
227 221
228 eo_key_del(timer, "_legacy");
229 eo_event_callback_del(timer, EFL_TIMER_EVENT_TICK,
230 _ecore_timer_legacy_tick, legacy),
231 free(legacy); 222 free(legacy);
223 eo_key_del(timer, "_legacy");
232 eo_del(timer); 224 eo_del(timer);
233 225
234 return data; 226 return data;