Fix close on crash patch which was  posted on the mailing list by Filipe Coelho
Merge pull request #558 from diizy/fixclosecrash

Fix close on crash patch which was  posted on the mailing list by Filipe...