Added extra checks to make sure that graphics operations arn't done on no longer valid graphics contexts

This commit is contained in:
Robert Osfield
2007-05-21 18:46:57 +00:00
parent d74d62ed0b
commit d22208f701
3 changed files with 33 additions and 28 deletions

View File

@@ -176,16 +176,16 @@ class OSGVIEWER_EXPORT Viewer : public osgViewer::View
releaseContext();
if (gc && gc->makeCurrent()) _currentContext = gc;
if (gc && gc->valid() && gc->makeCurrent()) _currentContext = gc;
}
inline void releaseContext()
{
if (_currentContext.valid())
if (_currentContext.valid() && _currentContext->valid())
{
_currentContext->releaseContext();
_currentContext = 0;
}
_currentContext = 0;
}