Destroy things properly, fixes memory leak
Merge pull request #1 from Frigolit/master

Destroy things properly, fixes memory leak