-
Notifications
You must be signed in to change notification settings - Fork 16
Description
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-killtimer#remarks
The KillTimer function does not remove WM_TIMER messages already posted to the message queue.
That means that ever if VTV killed a timer, it may still get the message. The procedure TBaseVirtualTree.WMTimer
does not check if that message is still expected and will execute it.
If a EditTimer
was scheduled (for whatever node was focused), but got killed by a mouse click (which as side effect would have moved the focus to another node, then the event could still be triggered, but would be applied to the new focused node.
Not checked, but likely similar issues can arise with other KillTimers.
I propose to have a set of flags (array , enumerated-set, bitmask, ...) to indicate which events are really expected. The flags could be removed in Killtimer (StopTimer) and the event prevented.