Skip to content

Commit 790b776

Browse files
committed
move displayDialog outside of synchronized blocks
1 parent a1a66bf commit 790b776

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignalDialogController.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ - (void)presentDialogWithTitle:(NSString * _Nonnull)title withMessage:(NSString
6767
//if so, we shouldn't present on top of existing dialog
6868
if (self.queue.count > 1)
6969
return;
70-
71-
[self displayDialog:request];
7270
}
71+
[self displayDialog:request];
7372
});
7473
}
7574

@@ -102,6 +101,7 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
102101

103102
- (void)delayResult:(int)result {
104103
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
104+
OSDialogRequest *nextDialog = nil;
105105
@synchronized (self.queue) {
106106
if (self.queue.count > 0) {
107107
let currentDialog = self.queue.firstObject;
@@ -116,8 +116,9 @@ - (void)delayResult:(int)result {
116116
if (self.queue.count == 0)
117117
return;
118118

119-
let nextDialog = self.queue.firstObject;
120-
119+
nextDialog = self.queue.firstObject;
120+
}
121+
if (nextDialog != nil) {
121122
[self displayDialog:nextDialog];
122123
}
123124
});

0 commit comments

Comments
 (0)