Open GoogleCodeExporter opened 9 years ago
The fix proposed solved the problem for me.
Thanks.
Original comment by joseluis...@gmail.com
on 25 Jul 2012 at 11:32
The fix doesn't make sense. The createEnvelope method uses
[NSMutableString string]
which is (according to apple convention), not a retaining function. In other
words, calling the function will not retain the string so there should be no
reason to release it.
Still, I applied the fix to my own code and it did do the trick for
instruments... I'm really confused about this one.
Original comment by danielba...@gmail.com
on 1 Aug 2012 at 9:07
Hi people,
I have dug the code and found the real fix for this.
The memory leak comes from line 69 of the SoapRequest.m:
request.postData = [postData retain];
where [postData retain] is our created string, from createEnvelope method.
Next, I was looking at the request.postData variable declaration and I don't
know why, it is declared as "id" type with a property with retain in
SoapRequest class.
So what we have: a autoreleased object, which is assigned with retain to a
property through a setter with retain and all-in-all => MemoryLeak.
I think all of you understand now how to fix it.
For those who don't, please follow my changes to fix your leaks, as it
perfectly works:
1. In SoapRequest.h replace variable declaration id postData to NSString*
postData;
2. In SoapRequest.h replace its property declaration to @property (copy,
nonatomic) NSString* postData; (Here, I additionally changed all of the
NSString property delcarations to "copy")
3. In SoapRequest.m, method (SoapRequest*) create: (SoapHandler*) handler
action: (SEL) action urlString: (NSString*) urlString soapAction: (NSString*)
soapAction postData: (NSString*) postData deserializeTo: (id) deserializeTo
change the row request.postData = [postData retain]; to request.postData =
postData;.
These 3 steps will solve your problems. Hope it will be also implemented in the
SudzcC framework as well.
Original comment by odan...@gmail.com
on 30 Aug 2012 at 3:10
Original issue reported on code.google.com by
pritesh....@gmail.com
on 7 May 2012 at 11:53