fix the crash caused by reference to dealloced object after the window controller is
released.
Merge pull request #28 from robin/feature/fix-crash-after-release

fix the crash caused by reference to dealloced object