diff --git a/src/modules/graphic/osggraph/OsgFX/OsgRender.cpp b/src/modules/graphic/osggraph/OsgFX/OsgRender.cpp index e9077f152..1d5e55da6 100755 --- a/src/modules/graphic/osggraph/OsgFX/OsgRender.cpp +++ b/src/modules/graphic/osggraph/OsgFX/OsgRender.cpp @@ -111,7 +111,9 @@ SDRender::~SDRender(void) m_RealRoot = NULL; delete thesky; + delete scenery; thesky = NULL; + scenery = NULL; SDTrack = NULL; } @@ -659,7 +661,7 @@ void SDRender::UpdateSky(double currentTime, double accelTime) } // At each call, update possibly high speed objects of the sky dome : the clouds. - SDScenery * scenery = (SDScenery *)getScenery(); + scenery = (SDScenery *)getScenery(); double r_WrldX = scenery->getWorldX(); double r_WrldY = scenery->getWorldY(); //double r_WrldZ = SDScenery::getWorldZ(); diff --git a/src/modules/graphic/osggraph/OsgFX/OsgRender.h b/src/modules/graphic/osggraph/OsgFX/OsgRender.h index 6ef99a4cf..3ca6edbe8 100755 --- a/src/modules/graphic/osggraph/OsgFX/OsgRender.h +++ b/src/modules/graphic/osggraph/OsgFX/OsgRender.h @@ -84,6 +84,7 @@ private: float sky_brightness; SDSky *thesky; + SDScenery *scenery; tTrack *SDTrack; public: