Proper way to remove a component
Posted: Fri 24. Jun 2011, 15:07
Hi all.
Here's the situation :
I have my rootNode with two children : geometryNode and cameraNode.
geometryNode has n boxComponent, each one having a geometry and appearance.
cameraNode has n cameraComponent, each one having a camera, a sceneGraphPath referencing both, a viewer referencing the sgp and referenced in a renderTrigger, and a JFrame using viewer's resources.
I was wondering if geometryNode.removeChild(boxComponent), as cameraNode.removeChild(cameraComponent), were the proper way to get rid of a box or a camera.
I can remove the viewer from the renderTrigger, and dispose the JFrame I guess.
But would that be enough to really release the objects and the memory ?
Thanks for the help
Here's the situation :
I have my rootNode with two children : geometryNode and cameraNode.
geometryNode has n boxComponent, each one having a geometry and appearance.
cameraNode has n cameraComponent, each one having a camera, a sceneGraphPath referencing both, a viewer referencing the sgp and referenced in a renderTrigger, and a JFrame using viewer's resources.
I was wondering if geometryNode.removeChild(boxComponent), as cameraNode.removeChild(cameraComponent), were the proper way to get rid of a box or a camera.
I can remove the viewer from the renderTrigger, and dispose the JFrame I guess.
But would that be enough to really release the objects and the memory ?
Thanks for the help