Skip to content

Commit 91aa4ad

Browse files
committed
restore library file
1 parent 33a701d commit 91aa4ad

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Crashlytics/Crashlytics/Components/FIRCLSBinaryImage.m

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

60-
if (!FIRCLSUnlinkIfExists(_firclsContext.readonly->binaryimage.path)) {
61-
FIRCLSSDKLog("Unable to reset the binary image log file %s\n", strerror(errno));
62-
}
63-
64-
bool needsClosing; // unneeded
65-
if (!FIRCLSBinaryImageOpenIfNeeded(&needsClosing)) {
66-
FIRCLSSDKLog("Error: Unable to open the binary image log file during init\n");
67-
}
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+
}
6864

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

7579
static bool FIRCLSBinaryImageOpenIfNeeded(bool* needsClosing) {

0 commit comments

Comments
 (0)