The good old:
“The object was disposed by an earlier call of dispose() on it.”
Everything up until View3D.dispose() runs fine.
It is quite important that it gets disposed properly and I don’t know why I get the error.
BTW - I’m using this startup method:
http://www.away3d.com/example/away3d_4.0_and_starling_interoperation
override public function dispose() : void {
super.dispose();
stage3DProxy.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
if (physicsWorld) {
physicsWorld.cleanWorld(true);
physicsWorld.dispose();
physicsWorld = null;
}
if (earth) {
earth.dispose();
earth = null;
}
light.dispose();
light = null;
lightPicker = null;
diceRigidBody.dispose();
diceRigidBody = null;
debugDraw = null;
accelerometer = null;
hc = null;
gameSignal.removeAll();
if (shakeTimer) {
shakeTimer.stop();
shakeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, handleMaxShakeTime);
shakeTimer = null;
}
if (stats) {
stats.unregisterView(view3D);
stats = null;
}
if (stage3DProxy) {
//stage3DProxy.dispose();
stage3DProxy = null;
stage3DManager = null;
}
if (view3D) {
Starling.current.nativeOverlay.removeChild(view3D);
view3D.dispose();
view3D = null;
}
}