Преглед изворни кода

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

Node dispose disposes all children as well
Daniel Salvadori пре 4 година
родитељ
комит
c9fb8e529a
1 измењених фајлова са 5 додато и 1 уклоњено
  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 {