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 6AAB61737D for ; Sat, 25 Apr 2015 21:37:11 +0000 (UTC) Received: (qmail 36846 invoked by uid 500); 25 Apr 2015 21:37:11 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 36816 invoked by uid 500); 25 Apr 2015 21:37:11 -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 36807 invoked by uid 99); 25 Apr 2015 21:37:11 -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; Sat, 25 Apr 2015 21:37:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 31230DFF75; Sat, 25 Apr 2015 21:37:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sgrebnov@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cordova-plugin-splashscreen git commit: CB-8758 [wp8]: UnauthorizedAccessException on hide() Date: Sat, 25 Apr 2015 21:37:11 +0000 (UTC) Repository: cordova-plugin-splashscreen Updated Branches: refs/heads/master fa60f01ad -> 62e92afae CB-8758 [wp8]: UnauthorizedAccessException on hide() When calling hide() from JS, the attempt to access Popup could happen on a background thread, which ends up throwing an UnauthorizedAccessException about cross-thread access. To address this, it's best to check the popup's state from within the UI thread. Fixes https://issues.apache.org/jira/browse/CB-8758 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/62e92afa Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/62e92afa Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/62e92afa Branch: refs/heads/master Commit: 62e92afae80c648a8018bde4e2b71a1ebe8de1d9 Parents: fa60f01 Author: Dan Polivy Authored: Thu Mar 26 11:52:10 2015 -0700 Committer: sgrebnov Committed: Sat Apr 25 14:32:17 2015 -0700 ---------------------------------------------------------------------- src/wp/SplashScreen.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/62e92afa/src/wp/SplashScreen.cs ---------------------------------------------------------------------- diff --git a/src/wp/SplashScreen.cs b/src/wp/SplashScreen.cs index feb4038..1c33c94 100644 --- a/src/wp/SplashScreen.cs +++ b/src/wp/SplashScreen.cs @@ -135,10 +135,9 @@ namespace WPCordovaClassLib.Cordova.Commands public void show(string options = null) { - - if (!popup.IsOpen) + Deployment.Current.Dispatcher.BeginInvoke(() => { - Deployment.Current.Dispatcher.BeginInvoke(() => + if (!popup.IsOpen) { popup.Child.Opacity = 0; @@ -162,17 +161,16 @@ namespace WPCordovaClassLib.Cordova.Commands { StartAutoHideTimer(); } - }); - } + } + }); } public void hide(string options = null) { - if (popup.IsOpen) + Deployment.Current.Dispatcher.BeginInvoke(() => { - Deployment.Current.Dispatcher.BeginInvoke(() => + if (popup.IsOpen) { - popup.Child.Opacity = 1.0; Storyboard story = new Storyboard(); @@ -191,8 +189,8 @@ namespace WPCordovaClassLib.Cordova.Commands popup.IsOpen = false; }; story.Begin(); - }); - } + } + }); } private void StartAutoHideTimer() --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org