Changeset 10126

Show
Ignore:
Timestamp:
04/30/09 15:13:19 (5 years ago)
Author:
robert
Message:

Added check against the validity of ViewerBase? to make sure that a null pointer isn't dereferenced.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/View.cpp

    r10098 r10126  
    16971697void View::requestRedraw() 
    16981698{ 
    1699     getViewerBase()->_requestRedraw = true; 
     1699    if (getViewerBase()) 
     1700    { 
     1701        getViewerBase()->_requestRedraw = true; 
     1702    } 
     1703    else 
     1704    { 
     1705        osg::notify(osg::INFO)<<"View::requestRedraw(), No viewer base has been assigned yet."<<std::endl; 
     1706    } 
    17001707} 
    17011708 
    17021709void View::requestContinuousUpdate(bool flag) 
    17031710{ 
    1704     getViewerBase()->_requestContinousUpdate = flag; 
     1711    if (getViewerBase()) 
     1712    { 
     1713        getViewerBase()->_requestContinousUpdate = flag; 
     1714    } 
     1715    else 
     1716    { 
     1717        osg::notify(osg::INFO)<<"View::requestContinuousUpdate(), No viewer base has been assigned yet."<<std::endl; 
     1718    } 
    17051719} 
    17061720