fix some memory leaks on iOS
Merge pull request #1121 from florianholzapfel/master

fix for some memory leaks on the iOS client