fix severe memory leak
Merge pull request #31 from fxdupont/memory

fix severe memory leak