Commits

Holger Frydrych  committed a84a113

[3072166] Fixed a crash on exit when SdkSample is initialised before Ogre::Root

  • Participants
  • Parent commits bdccd3f
  • Branches v1-7

Comments (0)

Files changed (2)

File Samples/Common/include/Sample.h

 		virtual void _setup(Ogre::RenderWindow* window, OIS::Keyboard* keyboard, OIS::Mouse* mouse, FileSystemLayer* fsLayer)
 #endif
 		{
+			// assign mRoot here in case Root was initialised after the Sample's constructor ran.
+			mRoot = Ogre::Root::getSingletonPtr();
 			mWindow = window;
 #if OGRE_PLATFORM != OGRE_PLATFORM_IPHONE
 			mKeyboard = keyboard;

File Samples/Common/include/SdkSample.h

 		virtual void _setup(Ogre::RenderWindow* window, OIS::Keyboard* keyboard, OIS::Mouse* mouse, FileSystemLayer* fsLayer)
 #endif
 		{
+			// assign mRoot here in case Root was initialised after the Sample's constructor ran.
+			mRoot = Ogre::Root::getSingletonPtr();
 			mWindow = window;
 #if OGRE_PLATFORM != OGRE_PLATFORM_IPHONE
 			mKeyboard = keyboard;