Skip to content

Commit

Permalink
Added feature-conditional statements for -finalize method to preven…
Browse files Browse the repository at this point in the history
…t use when ARC is available

– this fixes compilation warnings appearing since Xcode 8 due to deprecated Garbage collection support
  • Loading branch information
username0x0a committed Nov 14, 2016
1 parent 36f39b8 commit ef5b4b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fmdb/FMDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ - (instancetype)initWithPath:(NSString*)aPath {
return self;
}

#if ! __has_feature(objc_arc)
- (void)finalize {
[self close];
[super finalize];
}
#endif

- (void)dealloc {
[self close];
Expand Down Expand Up @@ -1461,10 +1463,12 @@ @implementation FMStatement
@synthesize useCount=_useCount;
@synthesize inUse=_inUse;

#if ! __has_feature(objc_arc)
- (void)finalize {
[self close];
[super finalize];
}
#endif

- (void)dealloc {
[self close];
Expand Down
2 changes: 2 additions & 0 deletions src/fmdb/FMResultSet.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ + (instancetype)resultSetWithStatement:(FMStatement *)statement usingParentDatab
return FMDBReturnAutoreleased(rs);
}

#if ! __has_feature(objc_arc)
- (void)finalize {
[self close];
[super finalize];
}
#endif

- (void)dealloc {
[self close];
Expand Down

0 comments on commit ef5b4b7

Please sign in to comment.