How to return non-zero return code when moreThanOneInstanceAllowed is false

Hi. I’m wondering if there’s a recommended way to do this. I’m currently calling setApplicationReturnValue in the moreThanOneInstanceAllowed override but it feels like I’m hijacking the purpose of the hook. Is there a more appropriate way to accomplish this?

Edit, on slightly further thought, using moreThanOneInstanceAllowed is pretty bad as it relies on it only ever being called in the context of quitting the app. Currently seems to be the case but I’d rather not rely on that.

I’ve solved this by adding a flag and checking against it in my override of JUCEApplication::shutdown and setting the return code there.