From e71b92dbcc786889b9ee5dcf8eaf4d0714133d4f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 14 Apr 2002 12:53:36 +0000 Subject: [PATCH] Fix for crash in SceneView introduced when ungarded use of _dispalySettings pointer was added, a if (valid) guard has been added to solve the problem. --- src/osgUtil/SceneView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 42ea47a63..358cb1df6 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -166,7 +166,9 @@ void SceneView::cull() if (_camera.valid()) { _camera->adjustAspectRatio(_viewport->aspectRatio()); - _camera->setScreenDistance(_displaySettings->getScreenDistance()); + + if (_displaySettings.valid()) + _camera->setScreenDistance(_displaySettings->getScreenDistance()); if (!projection) projection = osgNew osg::Matrix(_camera->getProjectionMatrix()); if (!modelview) modelview = osgNew osg::Matrix(_camera->getModelViewMatrix());