[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Memory problems in OO context




On Mon, 22 Nov 1999, Brian Matthews wrote:

>Yes. As Gisle's note says, you have to *explicitly* delete the html parse
>tree. Just undefing it doesn't do it, that's *implicitly* deleting it,
>which doesn't work because of circular references. Replace the undef $html
>with $html->delete and see if that changes the behavior at all. (And yes, I
>think that could be stated more clearly in the HTML pods.)

Great!  This sounds like exactly what I need.  But I'm not using
HTML::Element, and neither my class, nor HTML::Filter which I'm
subclassing, nor HTML::Parser which it is subclassing, define a delete
method.

I'm off to adapt the HTML::Element delete procedure to my code.

Thanks for the pointer (to Peter Hartmann).  I wasn't even looking in
HTML::Element, so I would never have seen it.  This is exactly what I was
looking for (help in reclaiming), but I couldn't voice it so articulately.

I wonder if Perl could add some warning or switch to warn when a data
structure still has positive ref-counts after an undef.  I realize there
are cases where this may be desired, but a warning might be handy to know
who are the undead.



--
MattLangford 


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org