We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f87f3b6 commit c714337Copy full SHA for c714337
QiniuSDK/Collect/QNUploadInfoReporter.m
@@ -127,14 +127,16 @@ - (void)saveReportJsonString:(NSString *)jsonString {
127
return;
128
}
129
130
+ NSFileHandle *fileHandler = nil;
131
@try {
132
// 上传信息写入recorder文件
- NSFileHandle *fileHandler = [NSFileHandle fileHandleForUpdatingAtPath:_recorderFilePath];
133
+ fileHandler = [NSFileHandle fileHandleForUpdatingAtPath:_recorderFilePath];
134
[fileHandler seekToEndOfFile];
135
[fileHandler writeData: [finalRecordInfo dataUsingEncoding:NSUTF8StringEncoding]];
- [fileHandler closeFile];
136
} @catch (NSException *exception) {
137
NSLog(@"NSFileHandle cannot write data: %@", exception.description);
138
+ } @finally {
139
+ [fileHandler closeFile];
140
141
142
0 commit comments