Skip to content

Commit

Permalink
Merge pull request ccgus#89 from g-Off/master
Browse files Browse the repository at this point in the history
Won't compile with ARC on OS X 10.8 and iOS 6 with dispatch_release
  • Loading branch information
ccgus committed Aug 8, 2012
2 parents de5bff4 + aef763e commit 5890f1a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/FMDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#define FMDBReturnRetained FMDBRetain

#define FMDBRelease(__v) ([__v release]);

#define FMDBDispatchQueueRelease(__v) (dispatch_release(__v));
#else
// -fobjc-arc
#define FMDBAutorelease(__v)
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/FMDatabasePool.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)dealloc {
FMDBRelease(_databaseOutPool);

if (_lockQueue) {
dispatch_release(_lockQueue);
FMDBDispatchQueueRelease(_lockQueue);
_lockQueue = 0x00;
}
#if ! __has_feature(objc_arc)
Expand Down
2 changes: 1 addition & 1 deletion src/FMDatabaseQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ - (void)dealloc {
FMDBRelease(_path);

if (_queue) {
dispatch_release(_queue);
FMDBDispatchQueueRelease(_queue);
_queue = 0x00;
}
#if ! __has_feature(objc_arc)
Expand Down

0 comments on commit 5890f1a

Please sign in to comment.