[Gambas-user] Closing Main form lets Timer keep going

Benoît Minisini g4mba5 at gmail.com
Tue Apr 19 11:52:57 CEST 2022


Le 19/04/2022 à 11:06, Rolf-Werner Eilert a écrit :
> In the latest Gambas versions, I stumbled over a strange new thing:
> 
> Say you have a Timer running with e. g. 1 minute and you close the Main 
> form, the Timer keeps going. You can see that in the IDE when running 
> the program from there: although the form has gone, the program still 
> runs and has to be stopped manually.
> 
> In Form_Close() I wrote
> 
>    Timer.Enabled = False
> 
> that solved the problem. But I guess it's not the way it's supposed to 
> run...
> 
> Regards
> 
> Rolf
> 

It depends.

Timer automatically stops if their event observer is destroyed.

Otherwise they keep running and prevent the program's termination (see 
the documentation about the event loop on the wiki).

But you can now set the Timer.Ignore property to tell Gambas to ignore 
that timer when quitting.

Regards,

-- 
Benoît Minisini


More information about the User mailing list