[Python-bugs-list] Tkinter Image names may be reused (PR#28)

guido@python.org guido@python.org
Wed, 14 Jul 1999 14:00:15 -0400 (EDT)


Full_Name: GvR
Version: 1.5.2b
OS: 
Submission from: eric.cnri.reston.va.us (132.151.1.38)
Submitted by: guido


Mark Lutz wrote me:

(BTW, this will probably never surface again (I'm stressing
the image object a bit), but I think there's a problem
with using the id() of an image as its name.  I ran into
a situation where an image was drawn in the wrong place, 
because a newly allocated image object had the same id()
as one very recently reclaimed.  It's very obscure, will
only happen if you have > 1 canvas in a process and happen
to be creating and deleting images very quickly, and is
too complex for me to describe further at the moment ;-).
I worked around it by first generating image names from a
simple counter, and then prebuilding all images up front.)