cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-8139) WP8. Fix callback for plugins with native ui (capture, contactPicker, BarcodeScanner, other)
Date Mon, 15 Dec 2014 17:06:14 GMT

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

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

GitHub user sgrebnov opened a pull request:

    https://github.com/apache/cordova-wp8/pull/68

    CB-8139 WP8. Fix callback for plugins with native ui (capture, contactPicker, etc)

    https://issues.apache.org/jira/browse/CB-8139
    
    Unload event could not be used to detect when CordovaView is not used anymore. For example,
this event is triggered when we execute command that shows some native elements on new page
and then we return back. In this case Unloaded event is called but, but control state is preserved
and we should continue to use that Cordova view instance. Same happens when app is deactivated
and then activated again (switch between apps)
    
    This commit changes the following:
    1. Allows command instances to be garbage collected => fixes corresponding memory leak
so that NativeExecution is no more required to call DetachHandlers for each command. This
fixes  CB-8139.
    2. Use Loaded and Unloaded events to add/remove handlers for native events; this makes
it possible for GC to destroy CordovaView when it is not required anymore

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

    $ git pull https://github.com/MSOpenTech/cordova-wp8 CB-8139

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

    https://github.com/apache/cordova-wp8/pull/68.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 #68
    
----
commit 1215509c58f6568e06aa6707e389f877513824f8
Author: sgrebnov <v-segreb@microsoft.com>
Date:   2014-12-15T14:52:27Z

    CB-8139 WP8. Fix callback for plugins with native ui (capture, contactPicker, BarcodeScanner,
other)
    
    Unload event could not be used to detect when CordovaView is not used anymore. For example,
this event is triggered when we execute command that shows some native elements on new page
and then we return back. In this case Unloaded event is called but, but control state is preserved
and we should continue to use that Cordova view instance.
    
    This commit changes the following:
    1. Allows command instances to be garbage collected => fixes corresponding memory leak
so that NativeExecution is no more required to call DetachHandlers for each command. This
fixes  CB-8139.
    2. Use Loaded and Unloaded events to add/remove handlers for native events; this makes
it possible for GC to destroy CordovaView when it is not required anymore

----


> WP8. Fix callback for plugins with native ui (capture, contactPicker, BarcodeScanner,
other)
> --------------------------------------------------------------------------------------------
>
>                 Key: CB-8139
>                 URL: https://issues.apache.org/jira/browse/CB-8139
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP8
>            Reporter: Sergey Grebnov
>            Assignee: Sergey Grebnov
>            Priority: Critical
>
> The [CB-7028] seems to be causing an issue with a barcode scanning, contact picker, media
capture plugins. When the plug-in is launched to show some additional native ui (via a Task),
it appears the WebBrowser_Unloaded event is triggered, which removes all of the callbacks,
including those for the plug-in that launched. As a result, when the plugin tries to return
data back to the script, it fails to do so.
> Sample code for org.apache.cordova.media-capture
> {code}
> // capture callback
> var captureSuccess = function (mediaFiles) {
>     alert('success: ' + JSON.stringify(mediaFiles));
> };
> // capture error callback
> var captureError = function (error) {
>     alert('Error code: ' + error.code, null, 'Capture Error');
> };
> // start video capture
> navigator.device.capture.captureVideo(captureSuccess, captureError, { limit: 1 });
> {code}



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

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


Mime
View raw message