Skip to content

issue with view3D.dispose() #64

@ramsestom

Description

@ramsestom

I have an ObjectContainer3D OC1 that contains 2 other ObjectContainer3D OC2 and OC3 (containing each one a mesh).
If I add only OC1 as child to my view3D, calling the view3D.dispose() function make the program to crash with this error:

Null Object Reference
Called from openfl._legacy.display.Stage.__pollTimers (openfl/_legacy/display/Stage.hx line 1084)
Called from openfl._legacy.display.Stage.__checkRender (openfl/_legacy/display/Stage.hx line 351)
Called from openfl._legacy.display.Stage.__render (openfl/_legacy/display/Stage.hx line 1103)
Called from openfl._legacy.display.DisplayObjectContainer.__broadcast (openfl/_legacy/display/DisplayObjectContainer.hx line 286)
Called from openfl._legacy.display.DisplayObject.__broadcast (openfl/_legacy/display/DisplayObject.hx line 161)
Called from openfl._legacy.display.DisplayObject.__dispatchEvent (openfl/_legacy/display/DisplayObject.hx line 182)
Called from openfl._legacy.events.EventDispatcher.dispatchEvent (openfl/_legacy/events/EventDispatcher.hx line 98)
Called from flixel.FlxGame.onEnterFrame (flixel/FlxGame.hx line 523)
Called from flixel.FlxGame.step (flixel/FlxGame.hx line 681)
Called from flixel.FlxGame.update (flixel/FlxGame.hx line 701)
Called from flixel.FlxGame.switchState (flixel/FlxGame.hx line 608)
Called from gui.states.PlayState3D.destroy (gui/states/PlayState3D.hx line 289)
Called from away3d.containers.View3D.dispose (away3d/containers/View3D.hx line 1003)
Called from away3d.core.managers.Stage3DProxy.dispose (away3d/core/managers/Stage3DProxy.hx line 151)
Called from away3d.core.managers.Stage3DProxy.freeContext3D (away3d/core/managers/Stage3DProxy.hx line 492)
Called from openfl._legacy.events.EventDispatcher.dispatchEvent (openfl/_legacy/events/EventDispatcher.hx line 98)
Called from away3d.core.managers.AGALProgram3DCache.onContext3DDisposed (away3d/core/managers/AGALProgram3DCache.hx line 58)
Called from away3d.core.managers.AGALProgram3DCache.dispose (away3d/core/managers/AGALProgram3DCache.hx line 68)
Called from away3d.core.managers.AGALProgram3DCache.destroyProgram (away3d/core/managers/AGALProgram3DCache.hx line 115)
Called from openfl.display3D.Program3D.dispose (openfl/display3D/Program3D.hx line 25)
Called from openfl.display3D.Context3D.__deleteProgram (openfl/display3D/Context3D.hx line 229)

Now, If my ObjectContainer3D OC1 only contains 1 Mesh (instead of OC2 and OC3), there is no error. view3D.dispose() succed. The same thing if I I only put OC2 (with 1 mesh) as child of OC1 (so whithout OC3) and then put OC1 as single child of view3D (everything is fine in that case). The issue only appear if I have in my view3D an ObjectContainer3D with more than 1 child in it...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions