From bc0ad79e4a3b200694bea5ce03116febc56e21f2 Mon Sep 17 00:00:00 2001 From: rvlander Date: Fri, 1 Mar 2013 12:51:14 +0000 Subject: [PATCH] OSG : segfault fix in SDCameras::~SDCameras() git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5234 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: b69dd341a344b4c2a841136e169565bcee6b65eb Former-commit-id: f2ef8d91dfba863cb28c7755594ffa96bc3a9410 --- src/modules/graphic/osggraph/OsgCamera.cpp | 2 +- src/modules/graphic/osggraph/OsgGraph.cpp | 8 ++++---- src/modules/graphic/osggraph/OsgMain.cpp | 2 +- src/modules/graphic/osggraph/OsgScreens.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modules/graphic/osggraph/OsgCamera.cpp b/src/modules/graphic/osggraph/OsgCamera.cpp index 282ef9f2d..2a18cfea6 100755 --- a/src/modules/graphic/osggraph/OsgCamera.cpp +++ b/src/modules/graphic/osggraph/OsgCamera.cpp @@ -2385,7 +2385,7 @@ void SDCameras::update(tCarElt * car, tSituation * s){ SDCameras::~SDCameras(){ for(int i=0;iremoveChildren(0,m_sceneroot->getNumChildren()); + //m_sceneroot->removeChildren(0,m_sceneroot->getNumChildren()); // Do the real track termination job. delete scenery; //delete m_sceneroot; diff --git a/src/modules/graphic/osggraph/OsgScreens.cpp b/src/modules/graphic/osggraph/OsgScreens.cpp index 7d47d8e29..9af3753e0 100755 --- a/src/modules/graphic/osggraph/OsgScreens.cpp +++ b/src/modules/graphic/osggraph/OsgScreens.cpp @@ -42,9 +42,9 @@ void SDScreens::Init(int x,int y, int width, int height, osg::ref_ptr mirrorCam = new osg::Camera; - SDView * view = new SDView(viewer->getCamera(),0,0,grWinw,grWinh,mirrorCam); + SDView * view = new SDView(viewer->getCamera(),0,0,grWinw,grWinh,mirrorCam.get()); viewer->setThreadingModel(osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext); osg::ref_ptr gw = viewer->setUpViewerAsEmbeddedInWindow(0, 0, grWinw, grWinh); @@ -66,7 +66,7 @@ void SDScreens::Init(int x,int y, int width, int height, osg::ref_ptr screenCam; for(int i=1;isetGraphicsContext(gw); @@ -83,7 +83,7 @@ void SDScreens::Init(int x,int y, int width, int height, osg::ref_ptraddChild(m_sceneroot); mirrorCam->setNodeMask(0); - view = new SDView(screenCam,0,0,grWinw,grWinh,mirrorCam); + view = new SDView(screenCam.get(),0,0,grWinw,grWinh,mirrorCam.get()); grScreens.insert(grScreens.end(),view);