Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #89 from g-Off/master

Won't compile with ARC on OS X 10.8 and iOS 6 with dispatch_release
  • Loading branch information...
commit 5890f1a0adf3d08599df8de68c608d445ecd1793 2 parents de5bff4 + aef763e
@ccgus authored
Showing with 24 additions and 2 deletions.
  1. +22 −0 src/FMDatabase.h
  2. +1 −1  src/FMDatabasePool.m
  3. +1 −1  src/FMDatabaseQueue.m
View
22 src/FMDatabase.h
@@ -12,6 +12,8 @@
#define FMDBReturnRetained FMDBRetain
#define FMDBRelease(__v) ([__v release]);
+
+ #define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
#else
// -fobjc-arc
#define FMDBAutorelease(__v)
@@ -21,6 +23,26 @@
#define FMDBReturnRetained(__v) (__v)
#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
#endif
View
2  src/FMDatabasePool.m
@@ -49,7 +49,7 @@ - (void)dealloc {
FMDBRelease(_databaseOutPool);
if (_lockQueue) {
- dispatch_release(_lockQueue);
+ FMDBDispatchQueueRelease(_lockQueue);
_lockQueue = 0x00;
}
#if ! __has_feature(objc_arc)
View
2  src/FMDatabaseQueue.m
@@ -59,7 +59,7 @@ - (void)dealloc {
FMDBRelease(_path);
if (_queue) {
- dispatch_release(_queue);
+ FMDBDispatchQueueRelease(_queue);
_queue = 0x00;
}
#if ! __has_feature(objc_arc)
Please sign in to comment.
Something went wrong with that request. Please try again.