From d572d7821487bb325a51ce325ffff3954dfbc3af Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 5 May 2018 12:31:00 +0100 Subject: [PATCH] Added C++ specific path for calling std::map<>::erase() to avoid issues with std::map<>::erase implementation that invalidates iterators --- src/osgDB/ObjectCache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osgDB/ObjectCache.cpp b/src/osgDB/ObjectCache.cpp index 49518918f..4736a039f 100644 --- a/src/osgDB/ObjectCache.cpp +++ b/src/osgDB/ObjectCache.cpp @@ -144,7 +144,11 @@ void ObjectCache::removeExpiredObjectsInCache(double expiryTime) { if (oitr->second.second<=expiryTime) { +#if __cplusplus > 199711L + oitr = _objectCache.erase(oitr); +#else _objectCache.erase(oitr++); +#endif } else {