Skip to content

Commit

Permalink
[FIAM] Fix an objc_retain crash (#12395)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 authored Feb 16, 2024
1 parent ca77625 commit 4a8f84b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions FirebaseInAppMessaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 10.22.0
- [fixed] Fixed an `objc_retain` crash. (#12393)

# 10.17.0
- [deprecated] All of the public API from `FirebaseInAppMessagingSwift` can now
be accessed through the `FirebaseInAppMessaging` module. Therefore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ - (void)setupAnalyticsEventListening {
}

- (BOOL)hasTestMessage {
return self.testMessages.count > 0;
@synchronized(self) {
return self.testMessages.count > 0;
}
}

- (nullable FIRIAMMessageDefinition *)nextOnAppLaunchDisplayMsg {
Expand All @@ -135,7 +137,7 @@ - (nullable FIRIAMMessageDefinition *)nextOnAppLaunchDisplayMsg {

- (nullable FIRIAMMessageDefinition *)nextOnAppOpenDisplayMsg {
@synchronized(self) {
// always first check test message which always have higher prirority
// always first check test message which always have higher priority
if (self.testMessages.count > 0) {
FIRIAMMessageDefinition *testMessage = self.testMessages[0];
// always remove test message right away when being fetched for display
Expand Down

0 comments on commit 4a8f84b

Please sign in to comment.