threadCallQueue loop can grow list forever
|Reported by:||ghazel||Owned by:|
|Cc:||spiv, Jean-Paul Calderone, 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.
Change History (12)
comment:1 Changed 11 years ago by
|Summary:||callFromThread consumes memory → threadCallQueue loop can grow list forever|