Parcourir la source

Merge pull request #214 from wolfgarnet/feature/dispose-children

Node dispose disposes all children as well
Daniel Salvadori il y a 4 ans
Parent
commit
c9fb8e529a
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      core/node.go

+ 5 - 1
core/node.go

@@ -132,7 +132,11 @@ func (n *Node) BoundingBox() math32.Box3 {
 func (n *Node) Render(gs *gls.GLS) {}
 
 // Dispose satisfies the INode interface.
-func (n *Node) Dispose() {}
+func (n *Node) Dispose() {
+	for _, child := range n.children {
+		child.Dispose()
+	}
+}
 
 // Clone clones the Node and satisfies the INode interface.
 func (n *Node) Clone() INode {