You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2015/04/25 23:37:11 UTC
cordova-plugin-splashscreen git commit: CB-8758 [wp8]:
UnauthorizedAccessException on hide()
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 <da...@cellartracker.com>
Authored: Thu Mar 26 11:52:10 2015 -0700
Committer: sgrebnov <v-...@microsoft.com>
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