Skip to content

Commit cae9e43

Browse files
committed
better
1 parent 9f5ffeb commit cae9e43

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

Crashlytics/Crashlytics/Components/FIRCLSBinaryImage.m

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,19 @@ void FIRCLSBinaryImageInit(void) {
5757
memset(&_firclsContext.writable->binaryImage, 0, sizeof(_firclsContext.writable->binaryImage));
5858
_firclsContext.writable->binaryImage.file.fd = -1;
5959

60-
dispatch_async(FIRCLSGetBinaryImageQueue(), ^{
61-
if (!FIRCLSUnlinkIfExists(_firclsContext.readonly->binaryimage.path)) {
62-
FIRCLSSDKLog("Unable to reset the binary image log file %s\n", strerror(errno));
63-
}
60+
if (!FIRCLSUnlinkIfExists(_firclsContext.readonly->binaryimage.path)) {
61+
FIRCLSSDKLog("Unable to reset the binary image log file %s\n", strerror(errno));
62+
}
6463

65-
bool needsClosing; // unneeded
66-
if (!FIRCLSBinaryImageOpenIfNeeded(&needsClosing)) {
67-
FIRCLSSDKLog("Error: Unable to open the binary image log file during init\n");
68-
}
69-
});
64+
bool needsClosing; // unneeded
65+
if (!FIRCLSBinaryImageOpenIfNeeded(&needsClosing)) {
66+
FIRCLSSDKLog("Error: Unable to open the binary image log file during init\n");
67+
}
68+
69+
FIRCLSFileClose(&_firclsContext.writable->binaryImage.file);
7070

7171
_dyld_register_func_for_add_image(FIRCLSBinaryImageAddedCallback);
7272
_dyld_register_func_for_remove_image(FIRCLSBinaryImageRemovedCallback);
73-
74-
dispatch_async(FIRCLSGetBinaryImageQueue(), ^{
75-
FIRCLSFileClose(&_firclsContext.writable->binaryImage.file);
76-
});
7773
}
7874

7975
static bool FIRCLSBinaryImageOpenIfNeeded(bool* needsClosing) {

Crashlytics/UnitTests/FIRCLSContextManagerTests.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ @implementation FIRCLSContextManagerTests
4343
- (void)setUp {
4444
self.fileManager = [[FIRCLSMockFileManager alloc] init];
4545
[[NSFileManager defaultManager] createDirectoryAtPath:self.fileManager.rootPath
46-
withIntermediateDirectories:YES
47-
attributes:nil
48-
error:nil];
46+
withIntermediateDirectories:YES
47+
attributes:nil
48+
error:nil];
4949
[self.fileManager createReportDirectories];
5050
[self.fileManager setupNewPathForExecutionIdentifier:TestContextReportID];
5151

0 commit comments

Comments
 (0)