| Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| index 2e26dc19e70fc186c39304658af538ce0b8224ef..13326792ff3b8bc9c673f6f4854698b0caf3b303 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| @@ -315,9 +315,13 @@ public class AwContents implements SmartClipProvider,
|
|
|
| private static final class DestroyRunnable implements Runnable {
|
| private final long mNativeAwContents;
|
| + // Hold onto a reference to the window (via its wrapper), so that it is not destroyed
|
| + // until we are done here.
|
| + private final WindowAndroidWrapper mWindowAndroid;
|
|
|
| - private DestroyRunnable(long nativeAwContents) {
|
| + private DestroyRunnable(long nativeAwContents, WindowAndroidWrapper windowAndroid) {
|
| mNativeAwContents = nativeAwContents;
|
| + mWindowAndroid = windowAndroid;
|
| }
|
| @Override
|
| public void run() {
|
| @@ -975,7 +979,7 @@ public class AwContents implements SmartClipProvider,
|
| // The native side object has been bound to this java instance, so now is the time to
|
| // bind all the native->java relationships.
|
| mCleanupReference =
|
| - new CleanupReference(this, new DestroyRunnable(mNativeAwContents));
|
| + new CleanupReference(this, new DestroyRunnable(mNativeAwContents, mWindowAndroid));
|
| }
|
|
|
| private void installWebContentsObserver() {
|
|
|