Skip to content
This repository

Removes dispatch_release when iOS >= 6 || OSX >= 1080 #260

Closed
wants to merge 1 commit into from

3 participants

Rod Wilhelmy Stephen Vanterpool AliSoftware
Rod Wilhelmy

dispatch_release is forbidden under ARC in new iOS and OSX versions

Instead of commenting out dispatch_release we could define an empty macro to support other iOS versions.

@see ccgus/fmdb@aef763e via @JHumphreyJr in Nyx0uf/NYXImagesKit#16

Rod Wilhelmy

Should we check for ARC also?

#if __has_feature(objc_arc)
Stephen Vanterpool
Collaborator

Merged.

AliSoftware

You should use the build-in OS_OBJECT_USE_OBJC for that instead, which is provided by Apple just for that actually.

#if OS_OBJECT_USE_OBJC
#define MRDispatchQueueRelease(x)
#else
#define MRDispatchQueueRelease(x) dispatch_release(x);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 24, 2012
Rod Wilhelmy rodowi Removes dispatch_release when iOS >= 6 || OSX >= 1080 597c209
This page is out of date. Refresh to see the latest.
2  MagicalRecord/Core/MagicalRecord+Actions.m
@@ -26,7 +26,7 @@ void reset_action_queue(void)
26 26 {
27 27 if (background_action_queue != NULL)
28 28 {
29   - // dispatch_release(background_action_queue);
  29 + MRDispatchQueueRelease(background_action_queue);
30 30 background_action_queue = NULL;
31 31 }
32 32 }
13 MagicalRecord/CoreData+MagicalRecord.h
@@ -45,3 +45,16 @@
45 45 #import "NSEntityDescription+MagicalDataImport.h"
46 46
47 47 #endif
  48 +
  49 +// @see https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c16a98d9f4f
  50 +#define MRDispatchQueueRelease(q) (dispatch_release(q))
  51 +
  52 +#if TARGET_OS_IPHONE
  53 + #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
  54 + #define MRDispatchQueueRelease(q)
  55 + #endif
  56 +#else
  57 + #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  58 + #define MRDispatchQueueRelease(q)
  59 + #endif
  60 +#endif

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.