Преглед изворни кода

Added feature-conditional statements for `-finalize` method to prevent use when ARC is available
– this fixes compilation warnings appearing since Xcode 8 due to deprecated Garbage collection support

Michal Zelinka пре 9 година
родитељ
комит
ef5b4b7993
2 измењених фајлова са 6 додато и 0 уклоњено
  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];