gwaldron/osgearth — pull request #289 by poweroftwo (2013-02-03 04:13:29+00:00)
Title: fixed MapNode.cpp to ensure that a handle to osgEarth::TerrainEngineNode...

... is held, particularly during initialization of the map node. Exception can occur without this change when loading the osgearth scene graph from a thread, as update/render occurs in the main thread.

The culprit is in osgViewer/Viewer.cpp here...
// update the Registry object cache.
osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExternalReferences(*getFrameStamp());
osgDB::Registry::instance()->removeExpiredObjectsInCache(*getFrameStamp());

... removeExpiredObjectsInCache() deletes the TerrainEngineNode and causes the exception.