Fixed: Main window destruction upon fatal error

The main window was destroyed behind the back of the window manager.