From fcd2f504e6cba0cfddbed145b5f859a617ce123c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 24 May 2005 10:46:21 +0000 Subject: [PATCH] Added check for an empty compile lists. --- src/osgDB/DatabasePager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 742c32f4e..79b920b78 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -805,6 +805,7 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime) { std::sort(_dataToCompileList.begin(),_dataToCompileList.end(),SortFileRequestFunctor()); + // prune all the old entries. DatabaseRequestList::iterator litr; int i=0; for(litr = _dataToCompileList.begin(); @@ -830,8 +831,9 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime) _dataToCompileList.erase(litr,_dataToCompileList.end()); } - - databaseRequest = _dataToCompileList.front(); + // advance to the next entry to compile if one is available. + databaseRequest = _dataToCompileList.empty() ? 0 : _dataToCompileList.front(); + } };