Best way to dispose of Away3D views?

I have a situation where I need to show an Away3D scene, remove it, then show a new one later. I found the dispose() method on the View3D class, but when I call it I get an error saying gl is null. The Program3D class wants to use it but it’s not there. Here’s my stack trace:

__deleteShaders Program3D.hx:597
dispose Program3D.hx:113
destroyProgram AGALProgram3DCache.hx:126
dispose AGALProgram3DCache.hx:76
onContext3DDisposed AGALProgram3DCache.hx:65
__dispatchEvent EventDispatcher.hx:402
dispatchEvent EventDispatcher.hx:246
freeContext3D Stage3DProxy.hx:557
dispose Stage3DProxy.hx:177
dispose View3D.hx:937

First off, am I using the right method to clear everything? And if I am, is there a bug in Program3D?

Yep, sounds like a bug in Program3D

There’s a refactor going on so it will be interesting to know if this is still occurring or not

That’s actually good to hear. For the time being I’ll just do a solution where I don’t have to dispose it. :slight_smile: Thanks!