Navigation Menu

Skip to content

Commit

Permalink
PopupMenu: Avoid potential crash when accessing exitingModalState member
Browse files Browse the repository at this point in the history
  • Loading branch information
reuk committed May 5, 2022
1 parent 4805b86 commit 319da16
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/juce_gui_basics/menus/juce_PopupMenu.cpp
Expand Up @@ -509,10 +509,14 @@ struct MenuWindow : public Component
auto resultID = options.hasWatchedComponentBeenDeleted() ? 0 : getResultItemID (item);

exitModalState (resultID);
exitingModalState = true;

if (makeInvisible && deletionChecker != nullptr)
setVisible (false);
if (deletionChecker != nullptr)
{
exitingModalState = true;

if (makeInvisible)
setVisible (false);
}

if (resultID != 0
&& item != nullptr
Expand Down

0 comments on commit 319da16

Please sign in to comment.