ensure that all resources are closed
Merge pull request #67 from h0nIg/resourceclose

ensure that all resources are closed