[ 
https://issues.apache.org/jira/browse/CB-8758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14382438#comment-14382438
 ] 

ASF GitHub Bot commented on CB-8758:
------------------------------------

GitHub user dpolivy opened a pull request:

    https://github.com/apache/cordova-plugin-splashscreen/pull/42

    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

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dpolivy/cordova-plugin-splashscreen CB8758

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-splashscreen/pull/42.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #42
    
----
commit 179831178b87531392afbf9539146a47689447d3
Author: Dan Polivy <d...@cellartracker.com>
Date:   2015-03-26T18:52:10Z

    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

----


> WP8: splashscreen.hide() causes exception to be thrown
> ------------------------------------------------------
>
>                 Key: CB-8758
>                 URL: https://issues.apache.org/jira/browse/CB-8758
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin SplashScreen, WP8
>            Reporter: Dan Polivy
>            Assignee: Jesse MacFadyen
>
> When calling the hide() method on splashscreen, on WP8, the call to 
> Popup.IsOpen throws a TargetInvocationException due to invalid cross-thread 
> access.
> I don't know the specifics, but most likely the threading model for how 
> plugins are executed has changed over time, exposing this exception.
> +             [System.Reflection.TargetInvocationException]   
> {System.Reflection.TargetInvocationException: Exception has been thrown by 
> the target of an invocation. ---> System.UnauthorizedAccessException: Invalid 
> cross-thread access.
>    at MS.Internal.XcpImports.CheckThread()
>    at System.Windows.DependencyObject.GetValueInternal(DependencyProperty dp)
>    at System.Windows.FrameworkElement.GetValueInternal(DependencyProperty dp)
>    at System.Windows.Controls.Primitives.Popup.get_IsOpen()
>    at WPCordovaClassLib.Cordova.Commands.SplashScreen.hide(String options)
>    --- End of inner exception stack trace ---
>    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] 
> arguments, Signature sig, Boolean constructor)
>    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, 
> Object[] parameters, Object[] arguments)
>    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags 
> invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
>    at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
>    at WPCordovaClassLib.Cordova.Commands.BaseCommand.InvokeMethodNamed(String 
> methodName, Object[] args)
>    at WPCordovaClassLib.Cordova.Commands.BaseCommand.InvokeMethodNamed(String 
> callbackId, String methodName, Object[] args)
>    at 
> WPCordovaClassLib.Cordova.NativeExecution.<>c__DisplayClass6.<ProcessCommand>b__2()}
>     System.Reflection.TargetInvocationException



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to