Unity2019 Stand Alone player not quitting

Application.Quit() does not exit the stand alone player on Windows10 when running a built game. (Editor and Hub is completely closed)

That is strange as it returns an exit code so it should always work. Could you put some code in to see if the problem doesn’t came from here. Another thing you can do is to enable debug mod in build parameters to show errors in build runtime.

It cancels play mode in the editor just fine, but doesnt exit the stand alone player. Here’s the code. I’ll try the debug mode as you suggested as well. Thanks.

public void QuitGame()
    {
        Debug.Log("isPlaying: " + Application.isPlaying);
        #if UNITY_EDITOR
            UnityEditor.EditorApplication.isPlaying = false;
        #else
            Application.Quit();
        #endif       
    }