Destroy only window when closed window.

Previous logic exit application when closed window.
It's wrong.