[Gambas-bugtracker] Bug #1764: Timer continues to tick for new task into method from parent
bugtracker at gambaswiki.org
bugtracker at gambaswiki.org
Sun Mar 29 19:22:43 CEST 2020
http://gambaswiki.org/bugtracker/edit?object=BUG.1764&from=L21haW4-
Comment #2 by Brian G:
Found two work arounds if and only if the timer was declared as a global pubic as in the code above.
but if the timer is private to a class or module in the parent, then there is in fact no way to directly stop the timer
I guess I could add special code to do this, or only use global timers.
or check shared variable in the main class to stop the timer executing its unintended operation.
For global timers these are useful.
add if MyTask.handle = application.id then tm.stop() to the main timer task
or
in startup of new task's main() add
main.tm.stop() which refers to the parent class directly which is called main in this case
Both are interesting, but are actually out of the scope of the controlling new task....
Makes things a little confusing
would it be possible to dynamically stop the time for the forked task or allow the task to define the timer and _timer function again
and allow access to the time and function directly?
or not, just add some documentation to timer class and task class describing how to handle timers in tasks
More information about the Bugtracker
mailing list