ecore: make sure we always manipulate a valid timer.

This commit is contained in:
Cedric BAIL 2017-02-06 15:35:48 -08:00
parent 8054037992
commit a8eeca3c2f
1 changed files with 7 additions and 0 deletions

View File

@ -126,6 +126,7 @@ _efl_loop_timer_efl_object_constructor(Eo *obj, Efl_Loop_Timer_Data *timer)
efl_wref_add(obj, &timer->object);
timer->initialized = EINA_FALSE;
timer->in = -1.0;
return obj;
}
@ -142,6 +143,12 @@ _efl_loop_timer_efl_object_finalize(Eo *obj, Efl_Loop_Timer_Data *pd)
pd->at += pd->in;
}
if (pd->in < 0)
{
ERR("You need to specify the interval of a timer to create a valid timer.");
return NULL;
}
pd->initialized = EINA_TRUE;
_efl_loop_timer_set(pd, pd->at, pd->in);