You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by sgrebnov <gi...@git.apache.org> on 2014/12/15 18:05:29 UTC

[GitHub] cordova-wp8 pull request: CB-8139 WP8. Fix callback for plugins wi...

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-...@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

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-wp8 pull request: CB-8139 WP8. Fix callback for plugins wi...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-wp8/pull/68#issuecomment-67132056
  
    I see this PR has been merged, thank you @purplecabbage !


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-wp8 pull request: CB-8139 WP8. Fix callback for plugins wi...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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