Can't shutdown MyGUI correctly.

drontng

13-05-2010 11:51:34

Hi. in my app I need to restart ogre to change window resolution. so I have to restart and MyGUI too.
there is destructor of my guiManager.


void CGUIManager::DestroyGUI()
{
MyGUI::LayoutManager::getInstance().unloadLayout(m_ListWindowRoot);
//m_GUI->destroyAllChildWidget();
MyGUI::ResourceManager::getInstance().clear();

m_WidgetVector.clear();
if(m_PlayerGUI)
{
delete m_PlayerGUI;
m_PlayerGUI = NULL;
}
if(m_Menus)
{
delete m_Menus;
m_Menus = NULL;
}
if(m_GUI)
{
m_GUI->shutdown();
delete m_GUI;
m_GUI = NULL;
}
}


And there is runtime exception on string "m_GUI->shutdown();" with message:
Unhandled exception at 0x00000000 in spacecode.exe: 0xC0000005: Access violation reading location 0x00000000.

I've tried to solve it a several days...
please help.

Altren

13-05-2010 17:19:02

First of all, what version of MyGUI do you use? Is there any errors in MyGUI.log?
Also MyGUI::ResourceManager::getInstance().clear();why do you call that? And you also shouldn't care about destroying widgets at MyGUI deinitialisation - on shutdown gui destroy them all.

Also you mentioned that you restart your application. So it's not first MyGUI shutdown, isn't it?

drontng

17-05-2010 19:25:44

I've used MyGUI 2.2.
On 3.0.1 there is no such error...
problem solved.
thanks =)