Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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.

Stephen Vanterpool blackgold9 closed this
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
Commits on Sep 24, 2012
  1. Rod Wilhelmy
This page is out of date. Refresh to see the latest.
2  MagicalRecord/Core/MagicalRecord+Actions.m
View
@@ -26,7 +26,7 @@ void reset_action_queue(void)
{
if (background_action_queue != NULL)
{
- // dispatch_release(background_action_queue);
+ MRDispatchQueueRelease(background_action_queue);
background_action_queue = NULL;
}
}
13 MagicalRecord/CoreData+MagicalRecord.h
View
@@ -45,3 +45,16 @@
#import "NSEntityDescription+MagicalDataImport.h"
#endif
+
+// @see https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c16a98d9f4f
+#define MRDispatchQueueRelease(q) (dispatch_release(q))
+
+#if TARGET_OS_IPHONE
+ #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
+ #define MRDispatchQueueRelease(q)
+ #endif
+#else
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+ #define MRDispatchQueueRelease(q)
+ #endif
+#endif
Something went wrong with that request. Please try again.