From 68c5e6e6cab350ae95482bd848785f2a8bd7b71f Mon Sep 17 00:00:00 2001 From: Laurens Voerman Date: Mon, 2 Mar 2020 10:44:59 +0100 Subject: [PATCH] fix bug in ProxyNode with DEFER_LOADING_TO_DATABASE_PAGER causing crash when children reorder during load. --- src/osgDB/DatabasePager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index dc1ebbb87..856250d1a 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -1646,7 +1646,12 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp) osg::ProxyNode* proxyNode = dynamic_cast(group.get()); if (proxyNode) { - proxyNode->getDatabaseRequest(proxyNode->getNumChildren()) = 0; + for (unsigned int i = 0; i < proxyNode->getNumFileNames(); ++i) { + if (proxyNode->getDatabaseRequest(i) == databaseRequest) { + proxyNode->getDatabaseRequest(i) = 0; + break; + } + } } }