summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-29 09:14:56 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-29 12:29:03 -0400
commitbf7b03051782243a75aff104107e155dcaedec63 (patch)
treec322edc535adae09f48c287de267a56669f3d97d
parent16e6cb7c7f7efc92db174b496a98c5fad9594343 (diff)
ecore/timer: fix handling of timer freeze during construction
Summary: timer has no loop pointer until it is finalized @fix Depends on D8918 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8947
-rw-r--r--src/lib/ecore/ecore_timer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c
index 37280e8ee3..96b1a13a51 100644
--- a/src/lib/ecore/ecore_timer.c
+++ b/src/lib/ecore/ecore_timer.c
@@ -321,13 +321,15 @@ ecore_timer_freeze(Ecore_Timer *timer)
321EOLIAN static void 321EOLIAN static void
322_efl_loop_timer_efl_object_event_freeze(Eo *obj, Efl_Loop_Timer_Data *timer) 322_efl_loop_timer_efl_object_event_freeze(Eo *obj, Efl_Loop_Timer_Data *timer)
323{ 323{
324 double now; 324 double now = 0.0;
325 325
326 efl_event_freeze(efl_super(obj, MY_CLASS)); 326 efl_event_freeze(efl_super(obj, MY_CLASS));
327 // Timer already frozen 327 // Timer already frozen
328 if (timer->frozen) return; 328 if (timer->frozen) return;
329 329
330 now = efl_loop_time_get(timer->loop); 330 /* not set if timer is not finalized */
331 if (timer->loop)
332 now = efl_loop_time_get(timer->loop);
331 /* only if timer interval has been set */ 333 /* only if timer interval has been set */
332 if (timer->initialized) 334 if (timer->initialized)
333 timer->pending = timer->at - now; 335 timer->pending = timer->at - now;