Fix a leaked window issue.