On 8 May 2000, (Randal L. Schwartz) wrote:
> >>>>> "Matt" == Matt Sergeant <[EMAIL PROTECTED]> writes:
>
> Matt> So there's never a full loop. When Object above goes out of scope, it
> Matt> calls DESTROY, which gets marshalled into the ObjectImpl's DESTROY method,
> Matt> allowing you to remove circular refs in your DESTROY method. I'm so
> Matt> chuffed with this... can you tell?
>
> This method (gah) fails when you are able to return a sub-object to a
> caller. So like any of the find-node thingies will have to do, you'll
> get the caller holding a pointer to a subelement, and then when the
> top-level pointer goes out of scope, you get DESTROY called on the
> children when in fact they don't need to be DESTROYed because there's
> still a pointer "inside" the structure.
I don't think that's true - or I'm misunderstanding what you're
saying. When I go:
$node->appendChild($othernode);
it calls $$node->appendChild($othernode), and appends the actual othernode
onto the list of children. So whenever you're iterating over children
you're getting the actual node, not the sub-node.
It _is_ the case that you get this sub-object when going to the parent
though. However that's not such a big deal - I hope... ;-)
(works so far, anyhow - and AxKit caches the tree so if it all goes
horribly wrong, xml.sergeant.org will just stop working. It's holding up
so far!).
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org
---
You are currently subscribed to perl-xml as: [[email protected]]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]