My monitoring tool uses 10 .GIF images palaced in labels to indicate when specific events occur. This app runs 24x7.
All images are created at the top of the program like this:
#image create photo $icon -file "C:/Path/$icon" -format gif
They are then applied to labels widgets when needed:
#label ".name" -text "text" -image $icon compound "center"
I have read that Tk images can be a source of memory "leaks" on long running processess. One suggestion is to delete all images "when they are no longer needed":
#foreach name [image names] {
# image delete $name
#}
Should I delete and recreate the images every so often to avoid a leak in my app? Or is this suggestion for apps that have the potential to use many different images that may never be used again?
All images are created at the top of the program like this:
#image create photo $icon -file "C:/Path/$icon" -format gif
They are then applied to labels widgets when needed:
#label ".name" -text "text" -image $icon compound "center"
I have read that Tk images can be a source of memory "leaks" on long running processess. One suggestion is to delete all images "when they are no longer needed":
#foreach name [image names] {
# image delete $name
#}
Should I delete and recreate the images every so often to avoid a leak in my app? Or is this suggestion for apps that have the potential to use many different images that may never be used again?