mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-24 23:23:51 +00:00
Check the resource group's existence before destroying it.
This commit is contained in:
parent
12511778d1
commit
e430dcfd8a
1 changed files with 7 additions and 3 deletions
|
@ -42,8 +42,13 @@ void CSVRender::Cell::createGridMaterials()
|
|||
|
||||
void CSVRender::Cell::destroyGridMaterials()
|
||||
{
|
||||
if(!Ogre::MaterialManager::getSingleton().getByName(PG_LINE_MATERIAL, DEBUGGING_GROUP).isNull())
|
||||
Ogre::MaterialManager::getSingleton().remove(PG_LINE_MATERIAL);
|
||||
if(Ogre::ResourceGroupManager::getSingleton().resourceGroupExists(DEBUGGING_GROUP))
|
||||
{
|
||||
if(!Ogre::MaterialManager::getSingleton().getByName(PG_LINE_MATERIAL, DEBUGGING_GROUP).isNull())
|
||||
Ogre::MaterialManager::getSingleton().remove(PG_LINE_MATERIAL);
|
||||
|
||||
Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(DEBUGGING_GROUP);
|
||||
}
|
||||
}
|
||||
|
||||
Ogre::ManualObject *CSVRender::Cell::createPathgridEdge(const std::string &name,
|
||||
|
@ -165,7 +170,6 @@ CSVRender::Cell::~Cell()
|
|||
}
|
||||
}
|
||||
destroyGridMaterials();
|
||||
Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(DEBUGGING_GROUP);
|
||||
|
||||
for(std::map<std::string, PathgridPoint *>::iterator iter (mPgPoints.begin());
|
||||
iter!=mPgPoints.end(); ++iter)
|
||||
|
|
Loading…
Reference in a new issue