[bug report] FileChooser memory leak & cannot open native browseForDirectory dialog in release build in a Console Application in Windows 10

[bug report] FileChooser memory leak & cannot open native browseForDirectory dialog in release build in a Console Application in Windows 10

this only happens in Console Application, but everythings fine in a GUI project.
can you sort that out?
thx!

this is my test code, this will cause memory leak, and unable to open the browseForDirectory dialog in release mode.

	FileChooser testChooser("test", File(), String(), true);

    if (testChooser.browseForDirectory())
    {
	    std::cout << testChooser.getResult().getFullPathName() << std::endl;
    }

Since you said, it happens only on a console application, did you create a ScopedJuceInitialiser?
This is needed to run anything asynchronous and to delete all the Singletons at shutdown.

Thanks a lot!
That make the browseForDirectory work in Release, but there’s still some memory leaks found in debug build:

Detected memory leaks!
Dumping objects ->
{238} normal block at 0x00000255DCEF7C70, 32 bytes long.
 Data: <  *             > 00 BE 2A 9C F6 7F 00 00 01 00 00 00 CD CD CD CD 
{209} normal block at 0x00000255DCE917F0, 32 bytes long.
 Data: <  *             > 00 BE 2A 9C F6 7F 00 00 01 00 00 00 CD CD CD CD 
Object dump complete.

I just added one line of code:
ScopedJuceInitialiser_GUI s;
in the beginning of the main method in the console project.
Is there still some steps I was missing? or this might be a juce bug?

and I use the master brunch for this test code.
haven’t test wether this would happen in the develop brunch yet.

This is harmless, and isn’t a JUCE bug. See here:

1 Like