Skip to content

Occasional crash in away3d.stereo.StereoView3D.as / away3d.stereo.StereoRenderer.as (stereofeature branch) #466

@bibeks

Description

@bibeks

Hi,

In StereoView3D / StereoRenderer, if you call StereoView3D.render() before context3D is fully set up, it causes a "null reference error" and the program crashes (unless you're catching null pointer refs). This works fine with the normal View3D.

The problem is in StereoRenderer.as, line 141:
_program3D = stage3DProxy.context3D.createProgram();

If you call render() too early, then "context3D" is null.

Given the setup of this system, I'm not sure where the appropriate place to check is, or what error to throw if context3D is null.

The best I could figure out is to add the following code to StereoView3D.as, at line 74:
//if context3D not active, don't render at this frame
if (!stage3DProxy.context3D) {
return;
}

(View3D does a similar sanity check - for something different - so I followed that model for my quick patch.)

All the best, and thanks for all the hard work.

  • Bibek

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions