Skip to content

Commit 18094f2

Browse files
committed
fix(core): track the three child on platform parent before passing off to the ancestor
This establishes the relationship between the three child and the platform parent so that destroying the platform parent will also remove the child from the scene
1 parent a3c504a commit 18094f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libs/core/src/lib/renderer/renderer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ export class NgtRenderer2 implements Renderer2 {
276276
if (pRS[NgtRendererClassId.type] === 'platform' && cRS[NgtRendererClassId.type] === 'three') {
277277
// if platform has parent, delegate to that parent
278278
if (pRS[NgtRendererClassId.parent]) {
279+
// but track the child for this parent as well
280+
addRendererChildNode(parent, newChild);
279281
return this.appendChild(pRS[NgtRendererClassId.parent], newChild);
280282
}
281283

0 commit comments

Comments
 (0)