Ticket #1741 defect closed fixed
threadCallQueue loop can grow list forever
|Reported by:||ghazel||Owned by:|
|Cc:||spiv, exarkun, glyph, jknight||Branch:|
callFromThread adds an event to self.threadCallQueue, then runUntilCurrent loops over that list calling events until the list is empty. If one of those events uses callFromThread, the list grows forever.
Now, I know there's no need to use callFromThread in this case since it's occurring in the main thread, but a very simple modification makes it work anyway.
foom preferred the method I implemented: (alus): I think the loop should be written to iterate over a slice (alus): or take a copy, or stop after a number (alus): or something to prevent this (foom): yes, it should get the count when it starts. (foom): and then take that many and stop (foom): and then delete those (alus): ok, that modification fixes the leak
Also included in the patch is a method to re-call wakeUp when more events were added during iteration.