removed memory leaks
Merge pull request #2 from mashkovmax/master

removed memory leaks