File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ CGUI_Impl::~CGUI_Impl()
146146
147147void CGUI_Impl::CreateRootWindow ()
148148{
149+ if (!m_pWindowManager || !m_pSystem)
150+ return ;
151+
149152 // Create dummy GUI root
150153 m_pTop = reinterpret_cast <CEGUI::DefaultWindow*>(m_pWindowManager->createWindow (" DefaultWindow" , " guiroot" ));
151154 m_pSystem->setGUISheet (m_pTop);
@@ -1828,8 +1831,14 @@ void CGUI_Impl::Cleanup()
18281831 // Recreate the root window (destroyed above via destroyAllWindows)
18291832 CreateRootWindow ();
18301833 }
1831- catch (std::exception& e)
1834+ catch (const std::exception& e)
18321835 {
18331836 WriteDebugEvent (SString (" CGUI_Impl::Cleanup - Exception: %s" , e.what ()));
1837+ m_pTop = nullptr ;
1838+ }
1839+ catch (...)
1840+ {
1841+ WriteDebugEvent (" CGUI_Impl::Cleanup() failed with unknown exception" );
1842+ m_pTop = nullptr ;
18341843 }
18351844}
You can’t perform that action at this time.
0 commit comments