in reply to Tk::Image delete method
Perl/Tk associates images with their corresponding MainWindow objects. Since you are only handling a single window at a time and repeatedly entering Tk's MainLoop, Tk is destroying the Image handles when it cleans up the MainWindow and shuts down. Run the program for a while and see if it leaks memory — I suspect that it does not.
This is not the normal way to use Tk in Perl — you actually do not have a single callback anywhere in the program and are not fully using Tk's MainLoop, which should normally be the last step of the main script's execution.
#!/usr/bin/perl use strict; use warnings; use Tk; # ... setup code that prepares the widget hierarchy ... MainLoop; # ... cleanup code as the program is exiting, usually there is nothing + here ... __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk::Image delete method
by Anonymous Monk on Dec 18, 2019 at 03:10 UTC | |
by bliako (Abbot) on Dec 18, 2019 at 09:50 UTC | |
by jcb (Parson) on Dec 19, 2019 at 00:22 UTC | |
by bliako (Abbot) on Dec 19, 2019 at 09:30 UTC | |
by Anonymous Monk on Dec 18, 2019 at 11:34 UTC | |
by jcb (Parson) on Dec 19, 2019 at 00:28 UTC | |
by Anonymous Monk on Dec 19, 2019 at 03:20 UTC | |
by bliako (Abbot) on Dec 18, 2019 at 12:23 UTC |