New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listbox itemconfigure leaks memory #38998
Comments
Calling itemconfigure on Tkinter.Listbox to change item Here's a small script that demostrates it: import Tkinter as Tk
Lb = None
def update_lb ():
global Lb
Lb.delete(0, Tk.END)
for ii in range(100):
Lb.insert(Tk.END, 'Item %d' % ii)
Lb.itemconfigure(ii, bg='red')
Lb.after(10, update_lb)
root = Tk.Tk()
Lb = Tk.Listbox(root)
Lb.pack()
Lb.after(1000, update_lb)
root.mainloop() |
Logged In: YES Sorry, but indentation got lost on script sample. Look at |
Logged In: YES Try a gc.collect() to see if the problem persists. |
Logged In: YES Calling gc.collect() seems to reduce the rate at which |
Logged In: YES The problem can be seen in an equivalent tcl script. This may indicate that the problem is not in Python itself, but in the third-party Tcl/Tk library. The script follows. I hope indentation isn't lost, but at least Tk has curly braces for just such an emergency. proc update_lb {} { listbox .lb |
Logged In: YES Closing this since it seems to be related to Tcl/Tk, not Python. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: