This commit is contained in:
Pfeil, Scott Robert 2020-10-15 17:00:23 -04:00
parent 128d531827
commit 48e3a5d187

View File

@ -157,11 +157,7 @@
if (self.topAlertObject.persistent) {
return;
}
self.timerSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
if (!self.timerSource) {
// Log error
return;
}
NSInteger dismissTime;
if (self.topAlertObject.topAlertDismissTime > 0) {
dismissTime = self.topAlertObject.topAlertDismissTime;
@ -169,8 +165,10 @@
dismissTime = TopAlertDismissTime;
}
__weak typeof(self) weakSelf = self;
self.timerSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
dispatch_source_set_timer(self.timerSource, dispatch_time(DISPATCH_TIME_NOW, dismissTime * NSEC_PER_SEC), DISPATCH_TIME_FOREVER, (1ull * NSEC_PER_SEC) / 10);
__weak typeof(self) weakSelf = self;
dispatch_source_set_event_handler(self.timerSource, ^{
if (weakSelf.isFinished || [weakSelf checkAndHandleForCancellation]) {
return;