mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-25 09:09:53 +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()
|
void CSVRender::Cell::destroyGridMaterials()
|
||||||
{
|
{
|
||||||
if(!Ogre::MaterialManager::getSingleton().getByName(PG_LINE_MATERIAL, DEBUGGING_GROUP).isNull())
|
if(Ogre::ResourceGroupManager::getSingleton().resourceGroupExists(DEBUGGING_GROUP))
|
||||||
Ogre::MaterialManager::getSingleton().remove(PG_LINE_MATERIAL);
|
{
|
||||||
|
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,
|
Ogre::ManualObject *CSVRender::Cell::createPathgridEdge(const std::string &name,
|
||||||
|
@ -165,7 +170,6 @@ CSVRender::Cell::~Cell()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
destroyGridMaterials();
|
destroyGridMaterials();
|
||||||
Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(DEBUGGING_GROUP);
|
|
||||||
|
|
||||||
for(std::map<std::string, PathgridPoint *>::iterator iter (mPgPoints.begin());
|
for(std::map<std::string, PathgridPoint *>::iterator iter (mPgPoints.begin());
|
||||||
iter!=mPgPoints.end(); ++iter)
|
iter!=mPgPoints.end(); ++iter)
|
||||||
|
|
Loading…
Reference in a new issue