GitHub user martincgg opened a pull request:

    https://github.com/apache/cordova-android/pull/122

    [CB-6837][Android] Fix: leaked window when hitting back button while alert 
being rendered

    Created arrayList on ChromeClient that it will register all showed 
AlertDialog, using CordovaChromeClient class, this applies to AlertDialogs 
object, included messages, prompts and confirm AlertDialog objects.
    
    When handleDestroy() method is called on the CordovaWebView, it will 
perform a call to ChromeClient class to destroy all AlerDialogs objects 
registered on the arrayList.
    This would perform a cleanup before the CordovaActivity is destroyed.
    
    dlg.show() returns an AlertDialog object, to be added to the arrayList.
    It can be:
    dialogsManager.add(dlg.show());
    But I think it looks cleaner as currently is.
    
    Tested on 4.2.2 & 4.4.2.

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

    $ git pull https://github.com/martincgg/cordova-android CB-6837

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

    https://github.com/apache/cordova-android/pull/122.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 #122
    
----
commit 0cb49e37687e032594e5eab9d4c5806beac124f4
Author: Martin Gonzalez <martin.c.glez.g...@gmail.com>
Date:   2014-09-22T19:45:58Z

    [CB-6837][Android] Fix: leaked window when hitting back button while alert 
being rendered
    
    Created arrayList on ChromeClient that it will register all showed
    AlertDialog, using CordovaChromeClient class, this applies to
    AlertDialogs object, included messages, prompts and confirm AlertDialog
    objects.
    
    When handleDestroy() method is called on the CordovaWebView, it will
    perform a call to ChromeClient class to destroy all AlerDialogs objects
    registered on the arrayList.
    This would perform a cleanup before the CordovaActivity is destroyed.
    
    dlg.show() returns an AlertDialog object, to be added to the arrayList.
    It can be:
    dialogsManager.add(dlg.show());
    But I think it looks cleaner as currently is.
    
    Tested on 4.2.2 & 4.4.2.

----


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

Reply via email to