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
This commit is contained in:
Mike Blumenkrantz 2019-05-29 09:14:56 -04:00
parent 16e6cb7c7f
commit bf7b030517
1 changed files with 4 additions and 2 deletions

View File

@ -321,13 +321,15 @@ ecore_timer_freeze(Ecore_Timer *timer)
EOLIAN static void
_efl_loop_timer_efl_object_event_freeze(Eo *obj, Efl_Loop_Timer_Data *timer)
{
double now;
double now = 0.0;
efl_event_freeze(efl_super(obj, MY_CLASS));
// Timer already frozen
if (timer->frozen) return;
now = efl_loop_time_get(timer->loop);
/* not set if timer is not finalized */
if (timer->loop)
now = efl_loop_time_get(timer->loop);
/* only if timer interval has been set */
if (timer->initialized)
timer->pending = timer->at - now;