From 7e3371b01c190df5ef25faaa5559c2a8e4958dc4 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 16 Sep 2022 03:23:15 -0700 Subject: [PATCH] Fix destroying wide angle camera (#718) Signed-off-by: Ian Chen --- ogre/src/OgreWideAngleCamera.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ogre/src/OgreWideAngleCamera.cc b/ogre/src/OgreWideAngleCamera.cc index 856e244ef..3f6cbfc62 100644 --- a/ogre/src/OgreWideAngleCamera.cc +++ b/ogre/src/OgreWideAngleCamera.cc @@ -193,6 +193,13 @@ void OgreWideAngleCamera::Destroy() this->dataPtr->ogreRenderTexture->getName()); this->dataPtr->ogreRenderTexture = nullptr; } + + if (!this->dataPtr->compMat.isNull()) + { + Ogre::MaterialManager::getSingleton().remove( + this->dataPtr->compMat->getName()); + this->dataPtr->compMat.setNull(); + } } //////////////////////////////////////////////////