fixed nasty bug (crash or memory leak)
Merge pull request #189 from bjouhier/nastybug

fixed nasty bug (crash or memory leak)