I want to save a file(*.txt) to the Specified path of my computer, but it doesn’t work according to the juce example of DialogsDemo. I had changed the path, but when it comes to this function
Your std::unique_ptr<FileChooser> declared at the top of the if scope will go out of scope and be deleted at the closing brace, so the fc->launchAsync() call is going to get the file picked callback on a deleted object. Make fc a member variable so it’s lifetime is correct.