Skip to content

error on view3D.dispose() (i now provided my code) #56

@VMan-2002

Description

@VMan-2002

Error occurs when trying to dispose a View3D.

Thread 0 (critical error: Null Object Reference):
*    27 : openfl.display3D.Program3D.__deleteShaders() at openfl/display3D/Program3D.hx:597
     26 : openfl.display3D.Program3D.dispose() at openfl/display3D/Program3D.hx:113
     25 : away3d.core.managers.AGALProgram3DCache.destroyProgram() at away3d/core/managers/AGALProgram3DCache.hx:126
     24 : away3d.core.managers.AGALProgram3DCache.dispose() at away3d/core/managers/AGALProgram3DCache.hx:76
     23 : away3d.core.managers.AGALProgram3DCache.onContext3DDisposed() at away3d/core/managers/AGALProgram3DCache.hx:65
     22 : openfl.events.EventDispatcher.__dispatchEvent() at openfl/events/EventDispatcher.hx:402
     21 : openfl.events.EventDispatcher.dispatchEvent() at openfl/events/EventDispatcher.hx:246
     20 : away3d.core.managers.Stage3DProxy.freeContext3D() at away3d/core/managers/Stage3DProxy.hx:557
     19 : away3d.core.managers.Stage3DProxy.dispose() at away3d/core/managers/Stage3DProxy.hx:177
     18 : away3d.containers.View3D.dispose() at away3d/containers/View3D.hx:937
     17 : object3d.VeView3D.destroy() at object3d/VeView3D.hx:66
     16 : flixel.group.FlxTypedGroup.destroy() at flixel/group/FlxGroup.hx:154
     15 : flixel.FlxState.destroy() at flixel/FlxState.hx:165
     14 : flixel.FlxGame.switchState() at flixel/FlxGame.hx:624
     13 : flixel.FlxGame.update() at flixel/FlxGame.hx:724
     12 : flixel.FlxGame.step() at flixel/FlxGame.hx:677
     11 : flixel.FlxGame.onEnterFrame() at flixel/FlxGame.hx:545
     10 : openfl.events.EventDispatcher.__dispatchEvent() at openfl/events/EventDispatcher.hx:402
      9 : openfl.display.DisplayObject.__dispatch() at openfl/display/DisplayObject.hx:1399
      8 : openfl.display.Stage.__broadcastEvent() at openfl/display/Stage.hx:1181
      7 : openfl.display.Stage.__onLimeRender() at openfl/display/Stage.hx:2046
      6 : lime.app._Event_lime_graphics_RenderContext_Void.dispatch() at lime/_internal/macros/EventMacro.hx:91
      5 : lime._internal.backend.native.NativeApplication.handleRenderEvent() at lime/_internal/backend/native/NativeApplication.hx:371
      4 : lime._internal.backend.native.NativeApplication.exec() at lime/_internal/backend/native/NativeApplication.hx:146
      3 : lime.app.Application.exec() at lime/app/Application.hx:150
      2 : ApplicationMain.create() at ApplicationMain.hx:135
      1 : ApplicationMain.main() at ApplicationMain.hx:26
      0 : hxcpp.__hxcpp_main() at ?:1

Original issue (possibly outdated) in 2015 by ramsestom from away3d/away3d-core-openfl

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions