add a minimal test case for an issue about the error occurring when a window is closed.