I decided that I had not really looked as closely at the Animation.pm file as I should have. Well, I looked at how the animated gif's multiple frames were being managed and discovered that they were being placed into an anonymous array in the object's 'self'-hash. I couldn't find any place where the references were being deleted.
So I added a function that pops the reference elements off the array and lets them simply die away. I was then able to open and close multiple animated gifs, far more than I was ever able to do with the previous version of Animation.pm.
Here is the function (it seems too simple):
sub del_frames { my $obj = shift; while( @{$obj->{'_frames_'}} ) { pop @{$obj->{'_frames_'}}; } }
In my application, I call del_frames after I stop using the animated gif and it is available and effective.
I hope that this may be useful to others. Tom
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: My fix for Tk::Animation
by moritz (Cardinal) on Jul 07, 2009 at 21:11 UTC | |
by TomKane (Beadle) on Jul 08, 2009 at 17:01 UTC |