Hopefully get rid of the assertion fail when you close the window.