Skip to content

Commit

Permalink
Fix a surge crash case on menu close in reaper
Browse files Browse the repository at this point in the history
Escape-closing surge with the patch menu open would segv because we didn't
do the safe pointer thing. We really need to do that everywhere (See
Closes surge-synthesizer#6558
  • Loading branch information
baconpaul committed Aug 21, 2022
1 parent 9319411 commit c955546
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/surge-xt/gui/widgets/PatchSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,12 @@ void PatchSelector::showClassicMenu(bool single_category)
o = sge->popupMenuOptions(getBounds().getBottomLeft());
}

contextMenu.showMenuAsync(o, [this](int) {
stuckHover = false;
endHover();
contextMenu.showMenuAsync(o, [that = juce::Component::SafePointer(this)](int) {
if (that)
{
that->stuckHover = false;
that->endHover();
}
});
}

Expand Down

0 comments on commit c955546

Please sign in to comment.