Crash when deallocation when using Ogre and CEGUI

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Rakkar
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 15, 2006 02:49

Crash when deallocation when using Ogre and CEGUI

Postby Rakkar » Sun Dec 03, 2006 18:07

Code: Select all

void CEGUIManager::Startup(Ogre::RenderWindow* window, Ogre::SceneManager* sceneManager)
{
   if (disabled)
      return;
   guiRenderer = new CEGUI::OgreCEGUIRenderer(window);
   guiRenderer->setTargetSceneManager(sceneManager);
   guiSystem = new CEGUI::System(guiRenderer);

   // TODO - don't hardcode these values once I understand all the parameters involved
   CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLook.scheme");
   guiSystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
   CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseMoveCursor");
   CEGUI::FontManager::getSingleton().createFont("Commonwealth-10.font");
   //guiSystem->setDefaultFont((CEGUI::utf8*)"Commonwealth-10.font");

   rootWindow=CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow", (CEGUI::utf8*)"Root_Do_Not_Delete"); 
   guiSystem->setGUISheet(rootWindow);
}
void CEGUIManager::Shutdown(void)
{
   if (disabled)
      return;
   if(rootWindow)
   {
      CEGUI::WindowManager::getSingleton().destroyWindow(rootWindow);
      rootWindow=0;
   }
   if(guiSystem)
   {
      delete guiSystem;
      guiSystem = 0;
   }
   if(guiRenderer)
   {
      delete guiRenderer;
      guiRenderer = 0;
   }
}


On this line it asserts
delete guiSystem;

ogretexturemanager.cpp line 39
Expression ms_Singleton

User avatar
tgraupmann
Quite a regular
Quite a regular
Posts: 78
Joined: Thu Aug 18, 2005 00:47
Contact:

Postby tgraupmann » Sun Apr 22, 2007 22:12

The texture being rendered to likely needs to be removed from an active imageset before the renderer can be destroyed. You'd think the renderer destructor might handle this for you.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 24 guests