FileChooser crash


#1

Hi,

FileChooser fc(String(""), String(""), String(""), true);
if (fc.browseForFileToSave(true)) {}

results in:

Stack overflow (parameters: 0x00000001, 0x00082F54)
in ntdll.dll

 

latest tip of juce (15 may 2014)

Microsoft Visual Studio Express 2013 for Windows Desktop

Windows 7
 

 

The same code works on Mac. This one works in Windows in contrast:

FileChooser fc(String(""), String(""), String(""), false);
if (fc.browseForFileToSave(true)) { }

Could this be a bug in juce?

 

Thanks a lot for your help,

Jonathan


#2

Well, I've never tried feeding it empty strings! I'll have a go, but rather than a bug, I'd say this is more "garbage-in-garbage-out" - try actually giving it some sensible parameters!

BTW, what's all that String("") stuff? For the best code-generation, you should use String() or String::empty. Or you can just write "" if you want the code to look more concise, but String("") is both more verbose and less efficient. And one of those parameters is a File, not a String!


#3
FileChooser fc("save pattern", File("C:\\"), "*.mid", true);

fc.browseForFileToSave(true);

 

crashes as well (JUCE: 29th May 2014). What could I be doing wrong?

 

Thanks a lot,

Jonathan


#4

If it's crashing then it must be because of the context in which you're calling that code, and not because of the code itself.

And obviously when you get a crash, you should be looking at the stack, and reporting what the whole trace looks like.. That's basic debugging - just saying "there's a stack overflow" isn't very helpful.


#5

Sorry for bothering you; I found out that it is not allowed to create a 1MB local array in the function that is calling the filechooser function when using the native one.

 

Sorry again,

Jonathan


#6

Sorry for bothering you; I found that it is not allowed to create a 1MB local array in the function that is calling the native filechooser function.

 

Sorry again,

Jonathan