1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-25 02:04:23 +00:00

PopupMenu: Avoid potential crash when accessing exitingModalState member

This commit is contained in:
reuk 2022-05-05 21:35:49 +01:00
parent 4805b86ca4
commit 319da1608d

View file

@ -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