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

Benoît Minisini g4mba5 at gmail.com
Tue Apr 19 13:18:50 CEST 2022


Le 19/04/2022 à 12:12, Rolf-Werner Eilert a écrit :
> 
> 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
> 

Note that it's the same problem if you are running a process.

-- 
Benoît Minisini


More information about the User mailing list