I have a need for several timers to hide stuff on screen after a certain time, such as OSD icons or other temporary info.
Now, I read somewhere that timers live on even if they go out of scope if there is an upcoming timer event, as that queued event keeps a reference to the timer.
Does this mean that it's safe to not only start a timer in, say, the sub that shows the object, but also dim it there, instead of at wider scope? In other words, I create the timer in that sub and starts it just before leaving the sub, and rely on the upcoming events reference to keep it alive long enough for it to fire once (which is all I need).
If this is a safe and sane thing to do, it would save me having unnecessary timers dimmed at a wider scope.
Now, I read somewhere that timers live on even if they go out of scope if there is an upcoming timer event, as that queued event keeps a reference to the timer.
Does this mean that it's safe to not only start a timer in, say, the sub that shows the object, but also dim it there, instead of at wider scope? In other words, I create the timer in that sub and starts it just before leaving the sub, and rely on the upcoming events reference to keep it alive long enough for it to fire once (which is all I need).
If this is a safe and sane thing to do, it would save me having unnecessary timers dimmed at a wider scope.