Message13027
Logged In: YES
user_id=33229
> When the BitmapImage object is no longer referenced, it is
> finalized; finalization causes "image delete" to be
> invoked.
Martin, thanks for the explanation. The behaviour is
counterintuitive for a Tk wrapper, because in Tk images are
eternal unless explicitly deleted. They are not GC'd when
they are unreferenced, and that's their documented behaviour.
IThe documentation I was refering to was the Image class
documentation in Tkinter.py - it makes no mention of this,
and as a rule in Python, I didn't think you had to keep a
global reference to everything you pass to any function if
you want it to be still alive when the function uses it.
Perhaps the Label/Canvas/Button instances should keep a
reference to it, which would be deleted when the instance
is deleted?
I know it's not in the Library Reference, as I contributed
the Tkinter section, but I think it should be clear in
Tkinter.py. |
|
Date |
User |
Action |
Args |
2007-08-23 14:07:45 | admin | link | issue632323 messages |
2007-08-23 14:07:45 | admin | create | |
|