Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

dispatch_retain & dispatch_release no longer needed with latest ARC #517

Merged
merged 1 commit into from Sep 17, 2012

Conversation

benoitsan
Copy link
Contributor

GCD queues are managed by ARC in iOS 6.0 and OS X 10.8. The dispatch_retain and dispatch_release methods cause the build to fail against these platforms.

The macro NEEDS_DISPATCH_RETAIN_RELEASE comes from the commit https://github.com/silvermana/CocoaHTTPServer/commit/f7129a7aae89b445d97285cb0dcbf230de2ecec1 of CocoaHTTPServer.

The macro definition is repeated in AFHTTPClient.m and AFHTTPRequestOperation.m. This could be perhaps improved.

@mattt
Copy link
Contributor

mattt commented Sep 16, 2012

I don't get any of the described build failures or warnings. What version of Xcode are you compiling with, and what flags do you have turned on?

@rastersize
Copy link
Contributor

@mattt You get them if you build using the OS X 10.8 or iOS 6 SDKs (not sure if must also target them for deployment). Both GCD and XPC objects are, since the mentioned versions, Objective-C objects whose memory is managed by ARC.

@benoitsan
Copy link
Contributor Author

@mattt @rastersize You only get the build failure if the OS X Deployment Target is 10.8 or iOS 6.

@mattt mattt merged commit 925c926 into AFNetworking:master Sep 17, 2012
@mattt
Copy link
Contributor

mattt commented Sep 17, 2012

Ah, I was getting Base SDK and Deployment Target mixed up. I've merged this all in and refactored in 8c536f5. Thanks!

aidansteele pushed a commit to aidansteele/EnumeratorKit that referenced this pull request Jan 25, 2014
As of the iOS 6 SDK, dispatch_* participates in ARC. See AFNetworking/AFNetworking#517
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants