During the applications execution i do this:
Code: Select all
local window = CEGUI.toFrameWindow( windowManager:createWindow( "AquaLook/FrameWindow", newWindowName ) )
window:subscribeEvent( 'DestructStart', DropMenu.HasClosed, DropMenu )
Now if this window is still there when i close the application i get a crash. From what i can see the problem is that during ~System() this is called:
Code: Select all
d_scriptModule->destroyBindings();
followed by:
Code: Select all
WindowManager::getSingleton().destroyAllWindows();
WindowManager::getSingleton().cleanDeadPool();
This in turn fires the DestructStart event to lua resulting in this error.
Code: Select all
[string "DropMenu.lua"]:29: attempt to index global 'CEGUI' (a nil value)
Because all the bindings have been destroyed, when the window is destroyed and DropMenu.HasClosed gets called trying to access the CEGUI namespace fails.
Im not sure what the best solution to this is. Maybe unsubscribing all events before beginning destruction of all windows?
ER.