cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject cordova-plugin-splashscreen git commit: CB-8836 - Crashes after animating splashscreen
Date Thu, 09 Apr 2015 21:07:19 GMT
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 <shazron@apache.org>
Authored: Thu Apr 9 14:07:18 2015 -0700
Committer: Shazron Abdullah <shazron@apache.org>
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


Mime
View raw message