free resources in destructor
Merge pull request #5 from mscdex/master

free resources in destructor