Explorar el Código

Merge pull request #206 from GrahamDennis/dispatch-arc-simplify

Simplify conditionals used to determine whether dispatch objects need explicit releasing.
August "Gus" Mueller hace 12 años
padre
commit
4ef996a622
Se han modificado 1 ficheros con 8 adiciones y 19 borrados
  1. 8 19
      src/FMDatabase.h

+ 8 - 19
src/FMDatabase.h

@@ -24,25 +24,14 @@
 
     #define FMDBRelease(__v)
 
-	#if TARGET_OS_IPHONE
-		// Compiling for iOS
-		#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
-			// iOS 6.0 or later
-			#define FMDBDispatchQueueRelease(__v)
-		#else
-			// iOS 5.X or earlier
-			#define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
-		#endif
-	#else
-		// Compiling for Mac OS X
-		#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080     
-			// Mac OS X 10.8 or later
-			#define FMDBDispatchQueueRelease(__v)
-		#else
-			// Mac OS X 10.7 or earlier
-			#define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
-		#endif
-	#endif
+// If OS_OBJECT_USE_OBJC=1, then the dispatch objects will be treated like ObjC objects
+// and will participate in ARC.
+// See the section on "Dispatch Queues and Automatic Reference Counting" in "Grand Central Dispatch (GCD) Reference" for details. 
+    #if OS_OBJECT_USE_OBJC
+        #define FMDBDispatchQueueRelease(__v)
+    #else
+        #define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
+    #endif
 #endif
 
 #if !__has_feature(objc_instancetype)