fix: address Objective-C -O1 ARC lifetime issue in GULNetworkURLSession (#255)

* fix: address Objective-C -O1 ARC lifetime issue in GULNetworkURLSession

* changelog
This commit is contained in:
Nick Cooke authored and GitHub committed 2026-10-13 12:24:12 -04:00
1 parent 79b3766eb5
commit 0aabc8f2e9
2 files changed
+5 -5

No files matched your search

+2
View File
@@ -7,6 +7,8 @@
call read `-[NSBundle appStoreReceiptURL]`, which makes a synchronous XPC call
to the LaunchServices daemon and could block the calling thread, often the
main thread, for seconds. (firebase/firebase-ios-sdk#16726)
- [fixed] Fix an ARC-related deadlock in `GULNetworkURLSession` under -O1
optimization. (#255)
# 8.1.4
- [fixed] `GULMutableDictionary` now ignores a `nil` key (and a `nil` object in
@@ -727,7 +727,9 @@ static const void *kGULSessionTrackerKey = &kGULSessionTrackerKey;
return;
}
GULSessionDeallocTracker *oldTrackerToReleaseOutsideLock = nil;
// Retain the old tracker until the lock is released. If it deallocates inside the lock,
// its -dealloc method will attempt to re-acquire the lock, resulting in a deadlock.
NS_VALID_UNTIL_END_OF_SCOPE GULSessionDeallocTracker *oldTrackerToReleaseOutsideLock = nil;
[[self sessionIDToFetcherMapReadWriteLock] lock];
GULNetworkURLSessionWeakHolder *holder =
@@ -759,10 +761,6 @@ static const void *kGULSessionTrackerKey = &kGULSessionTrackerKey;
[[[self class] sessionIDToFetcherMap] removeObjectForKey:sessionID];
}
[[self sessionIDToFetcherMapReadWriteLock] unlock];
// Retain the old tracker until the lock is released. If it deallocates inside the lock,
// its -dealloc method will attempt to re-acquire the lock, resulting in a deadlock.
(void)oldTrackerToReleaseOutsideLock;
}
+ (nullable GULNetworkURLSession *)sessionFromFetcherMapForSessionID:(NSString *)sessionID {