I'm Tk interface which loads in photos and displays them as thumbnail images. The problem I'm having is freeing the memory used from loading the original image. I want to get delete the original Photo object after I copy it to a to thumbnail. For example:
my $img = $main->Photo(
-format => "jpeg",
-file => "pic.jpg",
my $thumb = $main->Photo(-format => "jpeg");
$thumb->copy($img, -subsample => 16,16);
Now that I've got the thumb I want to get rid of the $img object. I've tried using $img->delete and $img->destroy, but neither of them actually free up the memory. I'm speculating that $main still holds a reference to the Photo object, but I don't know how to access that reference (if it does in fact exist).
If anyone has any ideas please let me know.