has not been commented out

That is why I said its plausible. I have vague memories of closures that would leak/stop leaking , randomly, if you added/removed lines

I suspect the problem is with Win32::Setupsup, but that's just an XS shell, leading me to believe the real culprit is in the lower-level C code. (I'm not a C programmer, BTW.)

I tend to agree, given this code hasn't been touched in 10+ years.

I don't see anything obvious in

sub get_property { my $self = shift; my ($property) = @_; return ( $self->get_properties($property) )[0]; } sub get_properties { use DDS; Dump(\@_); my $self = shift; my (@properties) = @_; my %properties = map { $_, "aiaia $_" } @properties; $self->exists or return undef; Win32::Setupsup::GetWindowProperties( $self->handle, \@properties, + \my %properties ) or return undef; }
XS(XS_NT__Setupsup_GetWindowProperties) { dXSARGS; // reset last error LastError(0); // window parameter SV *window = NULL; AV *propToGet = NULL; HV *windowProp = NULL; HV **clearRect = NULL; // check arguments if(items == 3 && SvIOKp(window = ST(0)) && SvROK(propToGet = (AV*) +ST(1)) && SvTYPE(propToGet = (AV*)SvRV(propToGet)) == SVt_PVAV && SvROK(windowProp = (HV*)ST(2)) && SvTYPE(windowProp = (HV*)SvRV(windowProp)) == SVt_PVHV) { // get window handle HWND hWnd = (HWND)SvIV(window); // clear reference clearRect = (HV**)hv_fetch(windowProp, PROP_RECT, strlen(PROP_ +RECT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); clearRect = (HV**)hv_fetch(windowProp, PROP_CLIENT, strlen(PRO +P_CLIENT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); hv_clear(windowProp); for(int count = 0; count <= av_len(propToGet); count++) { SV **curPropToGet = NULL; PSTR curPropToGetName = NULL; int curPropToGetIdx = 0; // look for app. property index if(!(curPropToGet = av_fetch(propToGet, count, 0)) || !(curPropToGetName = SvPV(*curPropToGet, PL_na)) || !(curPropToGetIdx = GetPropertyIndex(curPropToGetName +))) { LastError(UNKNOWN_PROPERTY_ERROR); clearRect = (HV**)hv_fetch(windowProp, PROP_RECT, strl +en(PROP_RECT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); clearRect = (HV**)hv_fetch(windowProp, PROP_CLIENT, st +rlen(PROP_CLIENT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); hv_clear(windowProp); break; } // now get and store the property if(!GetAndStoreWindowProp(hWnd, curPropToGetIdx, P_PERL wi +ndowProp)) { clearRect = (HV**)hv_fetch(windowProp, PROP_RECT, strl +en(PROP_RECT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); clearRect = (HV**)hv_fetch(windowProp, PROP_CLIENT, st +rlen(PROP_CLIENT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); hv_clear(windowProp); break; } } } else croak("Usage: Win32::Setupsup::GetWindowProperties($window, @p +roptoget, " "\\%%windowprop)\n"); RETURNRESULT(!LastError()); }

In reply to Re^3: Memory leak in Win32::CtrlGUI? by Anonymous Monk
in thread Memory leak in Win32::CtrlGUI? [SOLVED, sort of] by Dr. Mu

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.