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

Rolf-Werner Eilert rwe-sse at osnanet.de
Tue Apr 19 12:12:13 CEST 2022


Am 19.04.22 um 11:52 schrieb Benoît Minisini:
> 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,
>

Ah, I see, then I missed that thing. Thank you very much for the hint!

Regards
Rolf




More information about the User mailing list