WildcardFileFilter wavFiles = WildcardFileFilter("*.wav", "", "wavFiles");
fileChooser = new FileBrowserComponent(
FileBrowserComponent::FileChooserFlags::openMode
| FileBrowserComponent::FileChooserFlags::canSelectFiles
| FileBrowserComponent::FileChooserFlags::canSelectDirectories,
File("/Users/harrygardiner/Desktop"), &wavFiles, nullptr);
I'm trying to isolate .wav files in my audio application but it keeps telling me I have bad access problems, why is this?
Your wavFiles
lives on the Stack. fileChooser
is probably outliving wavFiles
and then tries to access it resulting in undefined behaviour.