Problem with setApplicationReturnValue


#1

I have a problem when using "setApplicationReturnValue" in this situation:

In my apps initialise function I do:

/* some random work */
setApplicationReturnValue(x);
quit();

The app will always return 0 regardless of the value of x, this is becuse of this code:

if (! app->initialiseApp())
   return 0;

in JUCEApplicationBase::main(). I think this should be:


if (! app->initialiseApp()) 
   return app->getApplicationReturnValue();

#2

Ah, good point, thanks!


#3

Thanks for the quick fix!


#4

Just a heads-up, this fix didn't make it to the repository (in juce_ApplicationBase.cpp).

--
Roeland


#5

No.. it's definitely fixed in the repo.