MainLoop.RunTimers() method throws System.ArgumentException after few hours.
See original GitHub issueCan someone explain me why I’m getting this error after around 8 hours of running? Terminal.Gui version 1.4
AmiAI - System.ArgumentException: An item with the same key has already been added. Key: 637865266986268040 (Parameter "key")
at System.Collections.Generic.SortedList"2.Add(TKey key, TValue value)
at Terminal.Gui.MainLoop.RunTimers()
at Terminal.Gui.MainLoop.MainIteration()
at Terminal.Gui.Application.RunLoop(RunState state, Boolean wait)
at Terminal.Gui.Application.Run(Toplevel view, Func"2 errorHandler)
at Terminal.Gui.Application.Run(Func"2 errorHandler)
at Pai.Ama.Run()
at Pai.Program.Main(String[] args)
Issue Analytics
- State:
- Created a year ago
- Comments:23
Top Results From Across the Web
MainLoop.RunTimers() method throws System. ...
After changing the code and starting timers via Application.Mainloop.Invoke(), the program didn't throw any exceptions after 24 hours of running ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tznind your code modification fixed the issue on MacOS. No more problems during 23 hours.
RunTimers
has an if/else statement in it. The ‘if’ condition usesAddTimer
but the ‘else’ just directly added to the dictionary. My PR adds the collision dodging to that else statement not just a new method.Old code (prior to PR)