make the window close event sync instead of async
merge to master
Merge pull request #156 from dart-gde/devoncarew_patch_window_close

make the window close event sync instead of async