Skip to content

Commit 1ae11e6

Browse files
committed
cleanup IAM window on the main thread when we get a error loading message content
All other cleanups are coming from the UI thread, but this one is not. This fixes a crash that happens if multiple IAMs have the same trigger and one of the IAMs after the first fails to load
1 parent 504f41f commit 1ae11e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

iOS_SDK/OneSignalSDK/OneSignalInAppMessages/Controller/OSMessagingController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,9 @@ - (void)messageViewDidDisplayPage:(OSInAppMessageInternal *)message withPageId:(
901901

902902
- (void)messageIsNotActive:(OSInAppMessageInternal *)message {
903903
[self deleteInactiveMessage:message];
904-
[self cleanUpInAppWindow];
904+
dispatch_async(dispatch_get_main_queue(), ^{
905+
[self cleanUpInAppWindow];
906+
});
905907
}
906908

907909
- (void)messageWillDisplay:(nonnull OSInAppMessageInternal *)message {

0 commit comments

Comments
 (0)