Since updating to JUCE 6.1.3 I keep getting a read access violation exception. At first, I thought it was an issue with our code, but I’m able to reproduce it in DemoRunner too.
- Build/run JUCE 6.1.3 DemoRunner on Windows (I’m using VS2019).
- Go to
- Click the
- Use the keyboard from this point onwards.
- Press the down arrow to highlight
- Press the right arrow to open the
- Press the right arrow again to open the
- Press the left arrow twice to close the submenus.
- If it works OK, repeat steps 3-8 a few times (it happens about 60% of the time for me).
Submenus close as expected.
Read access violation exception thrown (“peer-> was 0xFFFFFFFFFFFFFF37”) on juce_ModalComponentManager.cpp line 237.
Some investigation suggests that
juce::PopupMenu::HelperClasses::MenuWindow::keyPressed(key == KeyPress::leftKey) is using a
MenuWindow object that was deleted by a call to
exitModalState(). See juce_PopupMenu.cpp line 575. Using a
juce::WeakReference deletion checker in that context avoids the crash.
FWIW, I haven’t tried it on Mac yet, nor have I verified that it wasn’t already a problem in earlier JUCE releases (I just happened to notice it when testing after updating to 6.1.3).