Fix crash when multiple scenewidgets were closed. BtOgre was destroying resources each time.

loadfix
cc9cii 10 years ago
parent 70b5d6857a
commit 37a050873c

@ -11,6 +11,8 @@
#include <components/nifbullet/bulletnifloader.hpp>
#include <openengine/bullet/BulletShapeLoader.h>
#include <OgreSceneNode.h>
#include <openengine/bullet/BtOgreExtras.h> // needs Ogre::SceneNode defined
// PLEASE NOTE:
//
@ -199,6 +201,17 @@ namespace CSVWorld
{
delete (*iter).second;
mDebugDrawers.erase(iter);
// BtOgre::DebugDrawer destroys the resources leading to crashes in some
// situations. Workaround by recreating them each time.
if (!Ogre::ResourceGroupManager::getSingleton().resourceGroupExists("BtOgre"))
Ogre::ResourceGroupManager::getSingleton().createResourceGroup("BtOgre");
if (!Ogre::MaterialManager::getSingleton().resourceExists("BtOgre/DebugLines"))
{
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create("BtOgre/DebugLines", "BtOgre");
mat->setReceiveShadows(false);
mat->setSelfIllumination(1,1,1);
}
}
std::map<Ogre::SceneManager *, Ogre::SceneNode *>::iterator it =

@ -9,8 +9,6 @@
//#include <string>
//#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
//#include <boost/shared_ptr.hpp>
#include <OgreSceneNode.h>
#include <openengine/bullet/BtOgreExtras.h> // needs Ogre::SceneNode defined
//#include <OgreVector3.h>
//#include <OgreQuaternion.h>

Loading…
Cancel
Save