Browse Source

Added -finalize methods for GC compatibility

Dave DeLong 15 years ago
parent
commit
f457ee94c8
2 changed files with 12 additions and 0 deletions
  1. 8 0
      src/FMDatabase.m
  2. 4 0
      src/FMResultSet.m

+ 8 - 0
src/FMDatabase.m

@@ -21,6 +21,10 @@ - (id)initWithPath:(NSString*)aPath {
 	return self;
 }
 
+- (void)finalize {
+	[self close];
+}
+
 - (void)dealloc {
 	[self close];
     
@@ -722,6 +726,10 @@ - (void)setCachedStatements:(NSMutableDictionary *)value {
 
 @implementation FMStatement
 
+- (void)finalize {
+	[self close];
+}
+
 - (void)dealloc {
 	[self close];
     [query release];

+ 4 - 0
src/FMResultSet.m

@@ -19,6 +19,10 @@ + (id)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDat
     return [rs autorelease];
 }
 
+- (void)finalize {
+	[self close];
+}
+
 - (void)dealloc {
     [self close];