[Orxonox-commit 640] r3172 - in branches/pch/src/orxonox: . overlays/map
rgrieder at orxonox.net
rgrieder at orxonox.net
Sun Jun 14 21:04:31 CEST 2009
Author: rgrieder
Date: 2009-06-14 21:04:31 +0200 (Sun, 14 Jun 2009)
New Revision: 3172
Modified:
branches/pch/src/orxonox/GraphicsManager.cc
branches/pch/src/orxonox/overlays/map/Map.cc
branches/pch/src/orxonox/overlays/map/Map.h
Log:
Hack-fixed exit crash: The Map stores a static MaterialPtr that gets destroyed after main and therefore after delete Ogre::Root.
This is no real solution because the Map destructor isn't even called at all, so I had to place a call in the GraphicsManager.
Modified: branches/pch/src/orxonox/GraphicsManager.cc
===================================================================
--- branches/pch/src/orxonox/GraphicsManager.cc 2009-06-14 18:31:17 UTC (rev 3171)
+++ branches/pch/src/orxonox/GraphicsManager.cc 2009-06-14 19:04:31 UTC (rev 3172)
@@ -65,6 +65,9 @@
#include "tools/WindowEventListener.h"
#include "tools/ParticleInterface.h"
+// HACK!
+#include "overlays/map/Map.h"
+
namespace orxonox
{
class _OrxonoxExport OgreWindowEventListener : public Ogre::WindowEventListener
@@ -142,6 +145,9 @@
// Ogre::RenderSystem* renderer = this->ogreRoot_->getRenderSystem();
// renderer->destroyRenderWindow("Orxonox");
+ // HACK! This fixes an exit crash
+ Map::hackDestroyMap();
+
// unload all compositors
Ogre::CompositorManager::getSingleton().removeAll();
Modified: branches/pch/src/orxonox/overlays/map/Map.cc
===================================================================
--- branches/pch/src/orxonox/overlays/map/Map.cc 2009-06-14 18:31:17 UTC (rev 3171)
+++ branches/pch/src/orxonox/overlays/map/Map.cc 2009-06-14 19:04:31 UTC (rev 3172)
@@ -401,6 +401,12 @@
}
}
+ // HACK!
+ void Map::hackDestroyMap()
+ {
+ Map::OverlayMaterial_.setNull();
+ }
+
void Map::tick(float dt)
{
//Debug
Modified: branches/pch/src/orxonox/overlays/map/Map.h
===================================================================
--- branches/pch/src/orxonox/overlays/map/Map.h 2009-06-14 18:31:17 UTC (rev 3171)
+++ branches/pch/src/orxonox/overlays/map/Map.h 2009-06-14 19:04:31 UTC (rev 3172)
@@ -51,6 +51,8 @@
static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, const std::string& matName);
static void openMap();
+ // HACK!
+ static void hackDestroyMap();
//Not yet implemented
static const int maxRange_s=1000;
More information about the Orxonox-commit
mailing list