Getting error on View3D.dispose()

Software: Away3D 4.x

Freon, Newbie
Posted: 11 October 2012 07:33 PM   Total Posts: 13

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;
 
}
} 
   

Avatar
Fabrice Closier, Administrator
Posted: 11 October 2012 07:49 PM   Total Posts: 1265   [ # 1 ]

and the error is?

   

Freon, Newbie
Posted: 11 October 2012 07:50 PM   Total Posts: 13   [ # 2 ]

Exception fault: Error: Error #3694: The object was disposed by an earlier call of dispose() on it.

   

Freon, Newbie
Posted: 14 October 2012 04:33 PM   Total Posts: 13   [ # 3 ]

Any ideas anybody?

   

Freon, Newbie
Posted: 16 October 2012 02:05 PM   Total Posts: 13   [ # 4 ]

Well, for anyone else running in to this it is really quite obvious if you inspect the View3D.dispose() method.
It is because it calls _stage3DProxy.dispose()

I may be wrong but shouldn’t that only be if _shareContext is false?

That’s what I changed it to now, anyways.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X