AlreadyExistsException when calling loadWindowLayout()?
Posted: Tue Mar 13, 2007 23:41
I've worked around my HandleClicked() problem by deferreing deletion of the window layout until the event injection has returned.
However, now I have a problem when showing a GUI for the second time. The flow control is something like:
window = WindowManager::getSingleton().loadWindowLayout(name);
guiSystem->setGUISheet(window);
delete window;
guiSystem->setGUISheet(NULL);
window = WindowManager::getSingleton().loadWindowLayout(name);
Obviously, this is not all in one function; there's time between the calls.
When getting to the second load call (which attempts to open a new copy of the previously deleted window), I get an AlreadyExistsException thrown from within the library. I use the SDK library installer, not built myself.
Apparently, the GUI system is holding on to some concept of the previously window/layout, even though I've deleted it and un-configured it from the GUI system -- I draw the conclusion that I need to do something more to clean up the loaded GUI before attempting to re-load it.
The documentation for loadWindowLayout() doesn't mention this exception at all; nor does the destructor for Window say anything about special cleanup requirements. The description for setGUISheet() is similarly unhelpful. What am I doing wrong?
However, now I have a problem when showing a GUI for the second time. The flow control is something like:
window = WindowManager::getSingleton().loadWindowLayout(name);
guiSystem->setGUISheet(window);
delete window;
guiSystem->setGUISheet(NULL);
window = WindowManager::getSingleton().loadWindowLayout(name);
Obviously, this is not all in one function; there's time between the calls.
When getting to the second load call (which attempts to open a new copy of the previously deleted window), I get an AlreadyExistsException thrown from within the library. I use the SDK library installer, not built myself.
Apparently, the GUI system is holding on to some concept of the previously window/layout, even though I've deleted it and un-configured it from the GUI system -- I draw the conclusion that I need to do something more to clean up the loaded GUI before attempting to re-load it.
The documentation for loadWindowLayout() doesn't mention this exception at all; nor does the destructor for Window say anything about special cleanup requirements. The description for setGUISheet() is similarly unhelpful. What am I doing wrong?