From 988c69bba351f2fdac99d1ee9a8e929852a1e5e4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 23 Mar 2009 15:47:01 +0000 Subject: [PATCH] From Csaba Halasz, "here is another division by zero fix, this should be simpler ;) It caused problem if the stats display was popped up before the pager had anything to do." --- include/osgDB/DatabasePager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/osgDB/DatabasePager b/include/osgDB/DatabasePager index c1494b9eb..9f389568c 100644 --- a/include/osgDB/DatabasePager +++ b/include/osgDB/DatabasePager @@ -328,7 +328,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl double getMaximumTimeToMergeTile() const { return _maximumTimeToMergeTile; } /** Get the average time between the first request for a tile to be loaded and the time of its merge into the main scene graph.*/ - double getAverageTimeToMergeTiles() const { return _totalTimeToMergeTiles/static_cast(_numTilesMerges); } + double getAverageTimeToMergeTiles() const { return (_numTilesMerges > 0) ? _totalTimeToMergeTiles/static_cast(_numTilesMerges) : 0; } /** Reset the Stats variables.*/ void resetStats();