[x3d-public] removeNamedNode removes DEF children?

John Carlson yottzumm at gmail.com
Mon Jul 11 14:42:33 PDT 2022


What I’m concerned about is great-great-great children nodes of a parent
that gets removed.

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.


Perhaps we should look into Rust’s capability for loaning objects.   I
don’t know what Go has.

There’s been recent advances beyond garbage collection, I’m saying, and
Rust is leading the pack.

John

On Mon, Jul 11, 2022 at 4:11 PM Andreas Plesch <andreasplesch at gmail.com>
wrote:

> 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.
>
> But from a DOM programming perspective this may be surprising since the
> USE instance now seems to refer to a null value.
>
> I think improving documentation may be all what is needed.
>
> Thanks again, Andreas
>
> ---on the phone---
>
> On Mon, Jul 11, 2022, 2:08 PM Patrick Dähne <pdaehne at gmail.com> wrote:
>
>>
>>
>> > Am 11.07.2022 um 19:27 schrieb Andreas Plesch <andreasplesch at gmail.com
>> >:
>> >
>> > On Mon, Jul 11, 2022, 12:34 PM Patrick Dähne <pdaehne at gmail.com> wrote:
>> > > Thanks, very helpful. After the DEF name is removed, do the USE nodes
>> still rrefer to the now nameless node ?
>> >
>> > Yes. The scene graph does not care about DEF and USE, it is only needed
>> to serialize the scene graph into a textual representation.
>> >
>> > Ok.
>> >
>> >
>> >
>> > > Also, is there then a way to remove a node from the scene graph ?
>> >
>> > Yes, send events to fields (usually Group.children or
>> Group.removeChildren).
>> >
>> > Presumably, outer.removeChildren(inner) would then just remove the
>> child (DEF) node. The USE node would still refer to the (original) DEF node
>> ?
>>
>> Yes.
>>
>>
>> > Is there a way to remove all instances of a named node at once ?
>>
>> No.
>>
>>
>> Bye,
>>
>> Patrick
>>
>> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220711/dddb15a6/attachment-0001.html>


More information about the x3d-public mailing list