destroyGUIManager problem

Ivorne

10-06-2012 19:11:57

Hello, I am trying to use QuickGUI and it works fine. But I have problem, that when I call Root::destroyGUIManager function I get segfault.

Here is my code:


// init QuickGUI - create QuickGUI manager
QuickGUI::GUIManagerDesc md;
md.sceneManager = this->getDisplay()->getSceneManager();
md.viewport = this->getDisplay()->getCamera()->getViewport();
md.mouseCursorDesc.visible = false;
this->guiManager = QuickGUI::Root::getSingletonPtr()->createGUIManager( md );

// create gui sheet
int2 viewportSize = this->getDisplay()->getViewportSize();
int middle = ( viewportSize.x - HUD_WIDTH ) / 2;
QuickGUI::SheetDesc * sd = QuickGUI::DescManager::getSingleton().getDefaultSheetDesc();
sd->resetToDefault();
sd->widget_dimensions.size = QuickGUI::Size( HUD_WIDTH, HUD_HEIGHT );
sd->widget_dimensions.position = QuickGUI::Point( middle, HUD_TOP_SPACE );
sd->sheet_mouseCursorVisible = false;
this->hudSheet = QuickGUI::SheetManager::getSingleton().createSheet( sd );


// create panel
this->hudPanel = this->hudSheet->createPanel( QuickGUI::Rect(0,0, HUD_WIDTH, HUD_HEIGHT ) );
this->hudPanel->setSkinType( "hud" );

// set default sheet
this->guiManager->setActiveSheet( this->hudSheet );


This works just fine, but when I want to destroy it:

QuickGUI::Root::getSingletonPtr()->destroyGUIManager( this->guiManager );


I get segfault. Here is gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0 0x00007ffff79a6b7a in Ogre::SceneManager::firePreRenderQueues() () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
1 0x00007ffff79a8955 in Ogre::SceneManager::renderVisibleObjectsDefaultSequence() () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
2 0x00007ffff79ad184 in Ogre::SceneManager::_renderScene(Ogre::Camera*, Ogre::Viewport*, bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
3 0x00007ffff78146ec in Ogre::Camera::_renderScene(Ogre::Viewport*, bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
4 0x00007ffff79799f8 in Ogre::RenderTarget::_updateViewport(Ogre::Viewport*, bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
5 0x00007ffff797991b in Ogre::RenderTarget::_updateAutoUpdatedViewports(bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
6 0x00007ffff79793be in Ogre::RenderTarget::updateImpl() () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
7 0x00007ffff797995c in Ogre::RenderTarget::update(bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
8 0x00007ffff7965bbf in Ogre::RenderSystem::_updateAllRenderTargets(bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
9 0x00007ffff79a0d0a in Ogre::Root::_updateAllRenderTargets() () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
10 0x00007ffff79a0dd0 in Ogre::Root::renderOneFrame() () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
11 0x00007ffff79a0e15 in Ogre::Root::startRendering() () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.7.4
12 0x00000000004156d0 in BaseApplication::go (this=0x77d940) at src/BaseApplication.cpp:69
13 0x000000000040d37b in Display::mainLoop (this=0x77d940) at src/Display.cpp:20
14 0x000000000040eb68 in Game::mainLoop (this=0x7fffffffe150) at src/Game.cpp:23
15 0x0000000000418400 in main (argc=1, argv=0x7fffffffe268) at src/main.cpp:10


I would be grateful for any advices.
Thank you.