diff --git a/examples/osgterrain/osgterrain.cpp b/examples/osgterrain/osgterrain.cpp index 797652470..d57c6b404 100644 --- a/examples/osgterrain/osgterrain.cpp +++ b/examples/osgterrain/osgterrain.cpp @@ -198,14 +198,14 @@ int main(int argc, char** argv) return 1; } - osg::ref_ptr terrain = findTopMostNodeOfType(rootnode); + osg::ref_ptr terrain = findTopMostNodeOfType(rootnode.get()); if (!terrain) { // no Terrain node present insert one above the loaded model. terrain = new osgTerrain::Terrain; // if CoordinateSystemNode is present copy it's contents into the Terrain, and discard it. - osg::CoordinateSystemNode* csn = findTopMostNodeOfType(rootnode);; + osg::CoordinateSystemNode* csn = findTopMostNodeOfType(rootnode.get()); if (csn) { terrain->set(*csn); @@ -227,7 +227,7 @@ int main(int argc, char** argv) terrain->setBlendingPolicy(blendingPolicy); // register our custom handler for adjust Terrain settings - viewer.addEventHandler(new TerrainHandler(terrain)); + viewer.addEventHandler(new TerrainHandler(terrain.get())); // add a viewport to the viewer and attach the scene graph. viewer.setSceneData( rootnode.get() );