Re: Releasing WSMethodInvocationInvoke()
Re: Releasing WSMethodInvocationInvoke()
- Subject: Re: Releasing WSMethodInvocationInvoke()
- From: Gus Mueller <email@hidden>
- Date: Mon, 05 Mar 2012 13:44:24 -0800
On Mar 5, 2012, at 9:43 AM, Ian was here wrote:
> I'm having an issue with the following line of code:
>
> NSDictionary*serviceResult = (NSDictionary *)WSMethodInvocationInvoke( serviceCall );
>
> [serviceResult release];
>
>
> According to the documentation and the WSMethodInvocation.h header file, it is the caller's responsibility to release the returned serviceResult dictionary. However, when I run my code through the analyzer in Xcode, it says the serviceResult is released too many times, which would imply that it is already autoreleased. I Googled this and found several examples where it was not being released. If I comment-out the release code, the analyzer does not complain.
That's because it's missing a CF_RETURNS_RETAINED in the header for that method, which the analyzer needs to know what's going on. I'm not sure there's any way around this other than filing a bug and hoping Apple updates the headers in the next release.
(Another example of this is SecTransformExecute in Securty.framework)
-gus
--
August 'Gus' Mueller
Flying Meat Inc.
http://flyingmeat.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden