If we delete the window immediately other observers may get a invalid window and cause random crashes.