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-seg...@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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org