Browse Source

Merge pull request #549 from michalzelinka/master

Feature-conditional statements for `-finalize` method to opt-out GC methods when using ARC
August "Gus" Mueller 9 years ago
parent
commit
b0bf040d84
2 changed files with 6 additions and 0 deletions
  1. 4 0
      src/fmdb/FMDatabase.m
  2. 2 0
      src/fmdb/FMResultSet.m

+ 4 - 0
src/fmdb/FMDatabase.m

@@ -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];
@@ -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];

+ 2 - 0
src/fmdb/FMResultSet.m

@@ -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];