Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#5982: Fix ModifierHintPopup crash at shutdown when mainframe window …
…has been destroyed already
  • Loading branch information
codereader committed Jun 18, 2022
1 parent f09a8a0 commit f5f9ab1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions radiant/eventmanager/MouseToolManager.cpp
Expand Up @@ -244,10 +244,17 @@ void MouseToolManager::updateStatusbar(unsigned int newState)
_hintCloseTimer.StartOnce(HINT_POPUP_CLOSE_TIMEOUT_MSECS);
_shouldClosePopup = false;

// Ensure the popup exists
// Ensure the popup exists, but we need to have a valid main frame window
auto mainParent = GlobalMainFrame().getWxTopLevelWindow();

if (mainParent == nullptr)
{
return;
}

if (!_hintPopup)
{
_hintPopup = new ModifierHintPopup(GlobalMainFrame().getWxTopLevelWindow(), *this);
_hintPopup = new ModifierHintPopup(mainParent, *this);
}

_hintPopup->SetText(statusText);
Expand Down

0 comments on commit f5f9ab1

Please sign in to comment.