浏览代码

Merge pull request #789 from ccgus/robertmryan/mrc-garbage-value

Uninitialized object in manual reference counting
August "Gus" Mueller 5 年之前
父节点
当前提交
2417aa4698
共有 1 个文件被更改,包括 2 次插入6 次删除
  1. 2 6
      src/fmdb/FMDatabaseQueue.m

+ 2 - 6
src/fmdb/FMDatabaseQueue.m

@@ -301,17 +301,13 @@ - (BOOL)checkpoint:(FMDBCheckpointMode)mode name:(NSString *)name error:(NSError
 - (BOOL)checkpoint:(FMDBCheckpointMode)mode name:(NSString *)name logFrameCount:(int * _Nullable)logFrameCount checkpointCount:(int * _Nullable)checkpointCount error:(NSError * __autoreleasing _Nullable * _Nullable)error
 {
     __block BOOL result;
-    __block NSError *blockError;
-    
+
     FMDBRetain(self);
     dispatch_sync(_queue, ^() {
-        result = [self.database checkpoint:mode name:name logFrameCount:logFrameCount checkpointCount:checkpointCount error:&blockError];
+        result = [self.database checkpoint:mode name:name logFrameCount:logFrameCount checkpointCount:checkpointCount error:error];
     });
     FMDBRelease(self);
     
-    if (error) {
-        *error = blockError;
-    }
     return result;
 }