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(); + } } //////////////////////////////////////////////////