Open msching opened 10 years ago
I check the memory leak in my environment as well. People who are looking how to handle someone do not come?
The leak is because ASIInputStream is being cast to a CFReadStreamRef but ASIInputStream does not derive from NSInputStream it just wraps it.
My Solution is to get rid of ASIInputStream and create a NSInputStream instead in the ASIHTTPRequest startRequest: method.
It breaks using the metrics that ASIInputStream records but I wasn't using them.
I'm using a fairly old version of ASIHTTPRequest v.1.6.2 so your milage may vary.
it works! thanks a lot! BTW, if I subclass NSInputStream using this: https://github.com/bjhomer/HSCountingInputStream/blob/master/HSCountingInputStream/HSCountingInputStream.m, will also fix the leaks and make the post request working. But it is overriding undocumented methods. Is there any risks when my app is submitted to Appstore?
dealloc is not called on iOS7 when a request has postbody. Profile the iphone sample with leaks, click upload tab and upload then you will find ASIInputStream is leaking.