CB-8836 - Crashes after animating splashscreen

This commit is contained in:
Shazron Abdullah 2015-04-09 14:07:18 -07:00
parent 35272415d3
commit 559b300d29

View File

@ -289,16 +289,25 @@
} else if (fadeDuration == 0) { } else if (fadeDuration == 0) {
[self destroyViews]; [self destroyViews];
} else { } else {
__weak __typeof(self) weakSelf = self;
[UIView transitionWithView:self.viewController.view [UIView transitionWithView:self.viewController.view
duration:fadeDuration duration:fadeDuration
options:UIViewAnimationOptionTransitionNone options:UIViewAnimationOptionTransitionNone
animations:^(void) { animations:^(void) {
[_imageView setAlpha:0]; __typeof(self) strongSelf = weakSelf;
[_activityView setAlpha:0]; if (strongSelf != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[strongSelf->_activityView setAlpha:0];
[strongSelf->_imageView setAlpha:0];
});
}
} }
completion:^(BOOL finished) { completion:^(BOOL finished) {
if (finished) { if (finished) {
[self destroyViews]; dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf destroyViews];
});
} }
} }
]; ];