# FileChooser launchAsync crashs

**URL:** <https://forum.juce.com/t/filechooser-launchasync-crashs/49925>\
**Category:** MacOSX and iOS\
**Created:** [January 31, 2022, 6:40am UTC](https://forum.juce.com/t/filechooser-launchasync-crashs/49925 "2022-01-31T06:40:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nicolasdanet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nicolasdanet/32/56_2.png) [@nicolasdanet](https://forum.juce.com/u/nicolasdanet)\
**Post date:** [January 31, 2022, 7:01am UTC](https://forum.juce.com/t/filechooser-launchasync-crashs/49925/2 "2022-01-31T07:01:07Z")

</div>

Your `FileChooser` is on the stack, whereas it should be cached somewhere.  
It is destroyed right now at the end of the `buttonClicked` call.  
There’s a simple example into the documentation with a global variable.

[https://docs.juce.com/master/classFileChooser.html](https://docs.juce.com/master/classFileChooser.html)

See Also:

> [@File Chooser async](https://forum.juce.com/t/file-chooser-async/47657):
>
> I’m working on a port to AUv3 and it still has a few problems. One of them is the file chooser. In the AUv3 version on Mac and iOS it dosen’t work at all. And on the standalone-app on iOS it opens a file chooser, but I can’t load files and if I creat and save a file it’s empty. Maybe it has to that it’s not implemented in an async way? if (b == &savePreset){ auto presetManager = processor-\>getPresetManager(); String currentPresetPath = presetManager-\>getCurrentPresetDirectory(…

---

_[View the full topic](https://forum.juce.com/t/filechooser-launchasync-crashs/49925)._
