Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75A4E17804 for ; Thu, 9 Apr 2015 21:07:19 +0000 (UTC) Received: (qmail 72468 invoked by uid 500); 9 Apr 2015 21:07:19 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 72443 invoked by uid 500); 9 Apr 2015 21:07:19 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 72434 invoked by uid 99); 9 Apr 2015 21:07:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2015 21:07:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3B581E00A5; Thu, 9 Apr 2015 21:07:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Message-Id: <5cd60f4ac10e4fb2a1450a540f84247d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cordova-plugin-splashscreen git commit: CB-8836 - Crashes after animating splashscreen Date: Thu, 9 Apr 2015 21:07:19 +0000 (UTC) Repository: cordova-plugin-splashscreen Updated Branches: refs/heads/master 35272415d -> 559b300d2 CB-8836 - Crashes after animating splashscreen Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/559b300d Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/559b300d Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/559b300d Branch: refs/heads/master Commit: 559b300d29ba6eb2f951eb19b9bbf7ba9238a862 Parents: 3527241 Author: Shazron Abdullah Authored: Thu Apr 9 14:07:18 2015 -0700 Committer: Shazron Abdullah Committed: Thu Apr 9 14:07:18 2015 -0700 ---------------------------------------------------------------------- src/ios/CDVSplashScreen.m | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/559b300d/src/ios/CDVSplashScreen.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m index c28ae2f..3c0294b 100644 --- a/src/ios/CDVSplashScreen.m +++ b/src/ios/CDVSplashScreen.m @@ -289,19 +289,28 @@ } else if (fadeDuration == 0) { [self destroyViews]; } else { - [UIView transitionWithView:self.viewController.view - duration:fadeDuration - options:UIViewAnimationOptionTransitionNone - animations:^(void) { - [_imageView setAlpha:0]; - [_activityView setAlpha:0]; - } - completion:^(BOOL finished) { - if (finished) { - [self destroyViews]; - } - } - ]; + __weak __typeof(self) weakSelf = self; + + [UIView transitionWithView:self.viewController.view + duration:fadeDuration + options:UIViewAnimationOptionTransitionNone + animations:^(void) { + __typeof(self) strongSelf = weakSelf; + if (strongSelf != nil) { + dispatch_async(dispatch_get_main_queue(), ^{ + [strongSelf->_activityView setAlpha:0]; + [strongSelf->_imageView setAlpha:0]; + }); + } + } + completion:^(BOOL finished) { + if (finished) { + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf destroyViews]; + }); + } + } + ]; } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org