From: Tony H. <h...@re...> - 2005-10-06 16:49:47
|
In <20051005193031.GA3771@nono>, Thomas Leonard wrote: > The orignal commit that added the idle timeout had this log message: > > "Work around GTK bug triggered by Python's garbage collector > where changing the font would crash LookAndFeel (reported by > Stephen Watson)." > > So, we probably still need it for older GTKs. I've had a look back at the thread where that happened, and your comment was: : OK, GTK tries to update every toplevel window in its list when the : theme changes, even if the window has actually been destroyed. Windows : are not removed from the list until their ref-count is zero. Python's : garbage collector doesn't drop the refcount until it decides to do a : clean-up. : : As a quick fix, I've changed LookAndFeel to do a gc.collect() before : changing the font, which ensures that the just-closed FontSelector : isn't still hanging around. I'll file a GTK bug... So it looks like it's only needed if the font or theme has changed *and* another window has just been closed. That explains the gc.collect(), but I don't see why the g.idle_add() is necessary too. -- TH * http://www.realh.co.uk |