Fix for segfault on closing a file with the red X
Merge branch 'master' of github.com:PonyEdit/PonyEdit