<div dir="auto">What I’m concerned about is great-great-great children nodes of a parent that gets removed.</div><div dir="auto"><br></div><div dir="auto">I guess that DEF should be removed from the DOM standard and USE should take the place of DEF, but that leaves a memory leak between the removed parent and the DEF/USE1 gggrandchild.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Perhaps we should look into Rust’s capability for loaning objects.   I don’t know what Go has.</div><div dir="auto"><br></div><div dir="auto">There’s been recent advances beyond garbage collection, I’m saying, and Rust is leading the pack.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 11, 2022 at 4:11 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="auto">This applies to how removing a DOM node with x3dom should behave. From an X3D point of view it probably should behave like group.removeChildren, which x3dom does. That means removing a DOM DEF node does not have an effect on a USE node.<div dir="auto"><br></div><div dir="auto">But from a DOM programming perspective this may be surprising since the USE instance now seems to refer to a null value.</div><div dir="auto"><br></div><div dir="auto">I think improving documentation may be all what is needed.</div><div dir="auto"><br></div><div dir="auto">Thanks again, Andreas</div><div dir="auto"><br><div data-smartmail="gmail_signature" dir="auto">---on the phone---</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 11, 2022, 2:08 PM Patrick Dähne <<a href="mailto:pdaehne@gmail.com" target="_blank">pdaehne@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><br>
<br>
> Am 11.07.2022 um 19:27 schrieb Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" rel="noreferrer" target="_blank">andreasplesch@gmail.com</a>>:<br>
> <br>
> On Mon, Jul 11, 2022, 12:34 PM Patrick Dähne <<a href="mailto:pdaehne@gmail.com" rel="noreferrer" target="_blank">pdaehne@gmail.com</a>> wrote:<br>
> > Thanks, very helpful. After the DEF name is removed, do the USE nodes still rrefer to the now nameless node ?<br>
> <br>
> Yes. The scene graph does not care about DEF and USE, it is only needed to serialize the scene graph into a textual representation.<br>
> <br>
> Ok.<br>
> <br>
> <br>
> <br>
> > Also, is there then a way to remove a node from the scene graph ?<br>
> <br>
> Yes, send events to fields (usually Group.children or Group.removeChildren).<br>
> <br>
> Presumably, outer.removeChildren(inner) would then just remove the child (DEF) node. The USE node would still refer to the (original) DEF node ? <br>
<br>
Yes.<br>
<br>
<br>
> Is there a way to remove all instances of a named node at once ?<br>
<br>
No.<br>
<br>
<br>
Bye,<br>
<br>
Patrick<br>
<br>
</blockquote></div>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>