cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gonzalez (JIRA)" <>
Subject [jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window
Date Fri, 03 Oct 2014 06:20:34 GMT


Martin Gonzalez commented on CB-6837:

Hi Ian, 
I've made the required changes to fix this bug, by keeping track of the last AlertDialog showed.
Given the fact that the last one that is showed causes the leaked window, it would better
in this way. The original idea it was keep track of all of them, and perform that cleanup,
but now it seems like an unnecessary burden for a large amount of alerts in the application.

I've made a clean up of the PRs for master and 4.0.x branch, and are ready to be reviewed:


> Hitting Back button while alert being rendered causes leaked window
> -------------------------------------------------------------------
>                 Key: CB-6837
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.5.0
>            Reporter: Marcel Kinard
>            Assignee: Martin Gonzalez
>         Attachments: index.html
> On master and using dialogs plugin. Using a trivial app that has a button to create an
alert dialog after 500ms timeout. If the Back button is hit at approximately the same time
as the timer expires and the alert is to be shown, the following exception appears in logcat:
> D/CordovaWebView( 8178): The current URL is: file:///android_asset/www/index.html
> D/CordovaWebView( 8178): The URL at item 0 is: file:///android_asset/www/index.html
> D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 54ms, total
> D/CordovaActivity( 8178): Paused the application!
> D/CordovaWebView( 8178): Handle the pause
> W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
> W/InputMethodManagerService(  513): Starting input on non-focused client$Stub$Proxy@42396598
(uid=10050 pid=8178)
> D/CordovaActivity( 8178): CordovaActivity.onDestroy()
> D/CordovaWebView( 8178): >>> loadUrlNow()
> E/WindowManager( 8178): 
> E/WindowManager( 8178): android.view.WindowLeaked: Activity com.example.Example has leaked
window$DecorView{41f0d8b8 V.E..... R.....I. 0,0-465,256}
that was originally added here
> E/WindowManager( 8178): 	at android.view.ViewRootImpl.<init>(
> E/WindowManager( 8178): 	at android.view.WindowManagerGlobal.addView(
> E/WindowManager( 8178): 	at android.view.WindowManagerImpl.addView(
> E/WindowManager( 8178): 	at
> E/WindowManager( 8178): 	at$
> E/WindowManager( 8178): 	at org.apache.cordova.CordovaChromeClient.onJsAlert(
> E/WindowManager( 8178): 	at
> E/WindowManager( 8178): 	at
> E/WindowManager( 8178): 	at
> E/WindowManager( 8178): 	at
> E/WindowManager( 8178): 	at android.os.Handler.dispatchMessage(
> E/WindowManager( 8178): 	at android.os.Looper.loop(
> E/WindowManager( 8178): 	at
> E/WindowManager( 8178): 	at java.lang.reflect.Method.invokeNative(Native Method)
> E/WindowManager( 8178): 	at java.lang.reflect.Method.invoke(
> E/WindowManager( 8178): 	at$
> E/WindowManager( 8178): 	at
> E/WindowManager( 8178): 	at dalvik.system.NativeStart.main(Native Method)
> D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
> D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
> D/CordovaActivity( 8178): onMessage(exit,null)
> It looks like there is an attempt to show the alert dialog after the activity's onDestroy()
method has been called.
> When resuming the app by clicking on it's icon in the home screen or using the Multitask
button, the webview doesn't render completely, I see only a black screen with the usual status
bar. The app must be killed, and then it works fine after a restart. It appears that there
is a pretty small time window during the timeout in which this can be reproduced, something
on the order of 200ms.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message