Hi!
I just updated to JUCE 6.0.8.
And I found out that it breaks the native Windows file chooser.
Once I select a folder in the chooser, the UI freezes and I have to force quit the application.
The bug is easy to reproduce with a test application. (See also attached example application).
More details:
I am using the asynchronous version of the FileChooser class. I.e. I am calling FileChooser::launchAsync()
I can see that the file chooser successfully returns to run the lambda. But once the lambda is done it gets stuck somewhere in the JUCE code. And the whole UI is no longer responsive.
As far as I can see, it does not manage to get out of the destructor for ~Win32NativeFileChooser()
When I revert my JUCE version to 6.0.7, the bug is gone. So something must have changed in JUCE 6.0.8 to cause this bug.
Here is the code I use to start the file chooser dialog:
TestPluginAudioProcessorEditor::TestPluginAudioProcessorEditor (TestPluginAudioProcessor& p)
: AudioProcessorEditor (&p), processor (p)
{
fileChooserButton.setButtonText("Choose Directory");
addAndMakeVisible(fileChooserButton);
fileChooserButton.onClick = [this]()
{
libDirChooser = std::make_unique<FileChooser>("Select directory...", juce::File("C:\\"));
libDirChooser->launchAsync(FileBrowserComponent::openMode | FileBrowserComponent::canSelectDirectories,
[this](const FileChooser& fileChooser)
{
auto file = fileChooser.getResult();
if (file.exists())
{
String libDirString = file.getFullPathName();
DBG("Done with async file chooser.");
}
});
};
setSize (500, 400);
}
You can reproduce the bug with the attached test application.
Just run the app in stand-alone mode and click on the “Choose Directory” button.
In the file chooser select a directory and confirm.
As as a result the UI is completely frozen and you cannot even quit the app normally anymore.
Attachment:
FileChooserBug.zip (5.2 KB)