Fixes hang if closing unopened file
Merge pull request #712 from dazappa/master

Fixes hang if closing unopened file