Enabling an already enabled timer has no effect anymore.

[INTERPRETER]
* BUG: Enabling an already enabled timer has no effect anymore.
This commit is contained in:
gambas 2020-04-08 21:27:27 +02:00
parent b737880ee6
commit 68c503bc2e

View file

@ -41,6 +41,7 @@ static void enable_timer(CTIMER *_object, bool on)
{
if (on != (THIS->id != 0))
HOOK_DEFAULT(timer, WATCH_timer)((GB_TIMER *)THIS, on);
if (on && (THIS->id == 0))
GB_Error("Too many active timers");
}
@ -128,7 +129,7 @@ BEGIN_PROPERTY(Timer_Enabled)
if (READ_PROPERTY)
GB_ReturnBoolean(THIS->id != 0);
else
enable_timer(THIS, VPROP(GB_BOOLEAN));
enable_timer(THIS, !!VPROP(GB_BOOLEAN));
END_PROPERTY