Minimizing shipping build closes the game

Hi,

Whenever I minimize or use the windows key the game closes (basically whenever the game loses focus). I have set in the project settings “Allow close, Allow Maximize and Allow Minimize” to true. Why is this happening and how to prevent this?

Thanks