MyGUI 3 do not shutdown correctly?

cass

28-03-2010 04:49:48

Hi

I have written an application that allows the user to change the video modes during runtime. In order for this to happen I have to shutdown everything, including MyGUI and Ogre and restart Ogre and MyGUI.

However after I started MyGUI for the second time, the very first widget I create does not display, but the rest does. This only happens after the second startup of MyGUI even though I run exactly the same code to create the GUI. This leads me to the conclusion that either I did not shutdown/destroy something I was suppose to or I have discovered a leak/bug in MyGUI.

To shutdown MyGUI, I did:


MyGUI::OgrePlatform* ogre_platform;
MyGUI::GUI* mygui;

// ...
mygui->destroyAllChildWidget();
mygui->shutdown();
delete mygui;
mygui = 0;

ogre_platform->shutdown();
delete ogre_platform;
ogre_platform = 0;



And to shutdown OGRE:

Ogre::Root* ogre;
Ogre::SceneManager* scene;
Ogre::RenderWindow* window;
// ...

scene->destroyAllCameras();
scene->clearScene();

window->removeAllViewports();
window->destroy();
window = 0;

delete ogre;
ogre = 0;


I'm using Ogre 1.7 and MyGUI 3.0.1

souvarine

10-08-2010 13:24:27

I have exactly the same problem, any hints ?

I can confirm it happens on both Linux and Windows.

Altren

10-08-2010 17:00:02

Show your init/deinit code. In the code above OgrePlatform wasn't de-initialised.

souvarine

10-08-2010 18:35:13


// Init MyGUI
mGuiPlatform = new MyGUI::OgrePlatform();
mGuiPlatform->initialise(window->getRenderWindow(), mGuiSceneManager, SCREEN_RESOURCE_GROUP);
mGuiPlatform->getRenderManagerPtr()->setActiveViewport(window->getGuiViewPortIndex());
mGui = new MyGUI::Gui();
mGui->initialise("core.xml");

// Destroy gui
mGui->shutdown();
delete mGui;
mGuiPlatform->shutdown();
delete mGuiPlatform;


Did I forget to de-initialise OgrePlatform too ? How do I do that ?