Skip to content

Commit

Permalink
#5127: Fix a crash during shutdown due to _topLevelWindow pointing to…
Browse files Browse the repository at this point in the history
… a freed resource
  • Loading branch information
codereader committed Jan 2, 2021
1 parent b75f700 commit 3a7b013
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion radiant/ui/mainframe/MainFrame.cpp
Expand Up @@ -354,6 +354,7 @@ void MainFrame::onTopLevelFrameClose(wxCloseEvent& ev)

// Destroy the actual window
_topLevelWindow->Destroy();
_topLevelWindow = nullptr;

// wxWidgets is supposed to quit when the main window is destroyed, but
// it doesn't so we need to exit the main loop manually. Probably we
Expand All @@ -369,7 +370,7 @@ wxFrame* MainFrame::getWxTopLevelWindow()

wxBoxSizer* MainFrame::getWxMainContainer()
{
return _topLevelWindow != NULL ? _topLevelWindow->getMainContainer() : NULL;
return _topLevelWindow != nullptr ? _topLevelWindow->getMainContainer() : nullptr;
}

bool MainFrame::isActiveApp()
Expand Down

0 comments on commit 3a7b013

Please sign in to comment.