When closing the window, set the window to null
Merge pull request #133 from egofree71/master

When closing the window, set the window to null