Skip to content

Commit

Permalink
Destroy GpuRay camera on exit (#698)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Aug 4, 2022
1 parent 37441a5 commit f5101c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ogre2/src/Ogre2GpuRays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,17 @@ void Ogre2GpuRays::Destroy()
ogreCompMgr->removeWorkspace(this->dataPtr->ogreCompositorWorkspace2nd);
this->dataPtr->ogreCompositorWorkspace2nd = nullptr;
}

if (this->scene)
{
Ogre::SceneManager *ogreSceneManager = this->scene->OgreSceneManager();
if (ogreSceneManager)
{
ogreSceneManager->destroyCamera(this->dataPtr->ogreCamera);
this->dataPtr->ogreCamera = nullptr;
}
}
}

/////////////////////////////////////////////////
void Ogre2GpuRays::CreateRenderTexture()
Expand Down

0 comments on commit f5101c4

Please sign in to comment.