Bug or bad practice?
var colorMaterial:ColorMaterial = new ColorMaterial(0xff00ff);
var container:ObjectContainer3D = new ObjectContainer3D();
var sphere:Sphere = new Sphere(colorMaterial);
var sphere2:Sphere = new Sphere(colorMaterial);
container.addChild(sphere);
container.addChild(sphere2);
_view.scene.addChild(container);
container.dispose(true);
when the container starts disposing the seccond sphere, the material of the seccond sphere is already disposed, which causes an error:
RangeError: Error #1125: The index -1 is out of range 1.
at away3d.materials::MaterialLibrary/unregisterMaterial()[D:\1. WEBDESIGN\Projects\DaVine\lib\away3d\materials\MaterialLibrary.as:107]
at away3d.materials::MaterialBase/dispose()[D:\1. WEBDESIGN\Projects\DaVine\lib\away3d\materials\MaterialBase.as:165]
at away3d.entities::Mesh/dispose()[D:\1. WEBDESIGN\Projects\DaVine\lib\away3d\entities\Mesh.as:166]
at away3d.containers::ObjectContainer3D/dispose()[D:\1. WEBDESIGN\Projects\DaVine\lib\away3d\containers\ObjectContainer3D.as:618]
at BugTest()[D:\1. WEBDESIGN\Projects\DaVine\src\BugTest.as:29]