I know, I know -- posting a reponse to my own question is lame -- but I did find a solution that worked out just fine. I wouldn't call it a solution so much as a workaround, but here is what I did: Replaced setImage() with the following:
sub makeimages { my $w = shift; foreach (qw /uparrow downarrow none/) { $w->{$_}->delete if (defined($w->{$_})); $w->{$_} = $w->Compound; $w->{$_}->Line; $w->{$_}->Text( -text => $w->cget('-text'), ); if ($_ eq 'none') { $w->{$_}->Space(-width => 15); } else { $w->{$_}->Bitmap(-bitmap => $_); } } $w->OnDestroy( sub { foreach (qw /uparrow downarrow none/) { $w->{$_}->delete if (defined($w->{$_})); } } ); }
Then I just call makeimages() in columnInsert and configure the images using a configure(-image) on the button in question when I need to change it. I figured that three images in memory at once is way better than one at a time if having one at a time leads to a memory leak. Anyway, when doing it this way, there is no leakage, so it seems to me that the problem only occurs after repeated Compound image creations and deletions.

In reply to Re: Tk::Compound memory leak or poor coding? by neorants
in thread Tk::Compound memory leak or poor coding? by neorants

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.