Skip to content

Commit

Permalink
Merge pull request ccgus#549 from michalzelinka/master
Browse files Browse the repository at this point in the history
Feature-conditional statements for `-finalize` method to opt-out GC methods when using ARC
  • Loading branch information
ccgus authored Nov 15, 2016
2 parents 36f39b8 + ef5b4b7 commit b0bf040
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 b0bf040

Please sign in to comment.