From c617ea01633e947fe2ef62baa6cff82ccb774f8d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 23 Jun 2011 16:36:36 +0000 Subject: [PATCH] Fixed virtual method mismtaches between subclasses and parent classes. --- include/osg/OcclusionQueryNode | 4 ++-- include/osgViewer/Viewer | 2 +- src/osg/OcclusionQueryNode.cpp | 9 ++++++--- src/osgViewer/Viewer.cpp | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/osg/OcclusionQueryNode b/include/osg/OcclusionQueryNode index 8d9674f4e..b45cf3e78 100644 --- a/include/osg/OcclusionQueryNode +++ b/include/osg/OcclusionQueryNode @@ -74,8 +74,8 @@ public: unsigned int getNumPixels( const osg::Camera* cam ); - - void releaseGLObjects( osg::State* state = 0 ); + virtual void releaseGLObjects( osg::State* state = 0 ) const; + static void deleteQueryObject( unsigned int contextID, GLuint handle ); static void flushDeletedQueryObjects( unsigned int contextID, double currentTime, double& availableTime ); static void discardDeletedQueryObjects( unsigned int contextID ); diff --git a/include/osgViewer/Viewer b/include/osgViewer/Viewer index d8b612eab..998e24921 100644 --- a/include/osgViewer/Viewer +++ b/include/osgViewer/Viewer @@ -39,7 +39,7 @@ class OSGVIEWER_EXPORT Viewer : public ViewerBase, public osgViewer::View META_Object(osgViewer,Viewer); /** Take all the settings, Camera and Slaves from the passed in view(er), leaving it empty. */ - virtual void take(View& rhs); + virtual void take(osg::View& rhs); /** Set the Stats object used for collect various frame related timing and scene graph stats.*/ diff --git a/src/osg/OcclusionQueryNode.cpp b/src/osg/OcclusionQueryNode.cpp index b03425fad..a701d85a1 100644 --- a/src/osg/OcclusionQueryNode.cpp +++ b/src/osg/OcclusionQueryNode.cpp @@ -373,14 +373,17 @@ QueryGeometry::getNumPixels( const osg::Camera* cam ) void -QueryGeometry::releaseGLObjects( osg::State* state ) +QueryGeometry::releaseGLObjects( osg::State* state ) const { if (!state) + { // delete all query IDs for all contexts. - reset(); - + const_cast(this)->reset(); + } else { + OpenThreads::ScopedLock lock( _mapMutex ); + // Delete all query IDs for the specified context. unsigned int contextID = state->getContextID(); ResultMap::iterator it = _results.begin(); diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 4d1d2d677..746926861 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -248,7 +248,7 @@ Viewer::~Viewer() OSG_INFO<<"Viewer::~Viewer() end destructor getThreads = "<