Commit afdaf434 authored by bcwhite's avatar bcwhite Committed by Commit bot

Increase safety of delayed-keyboard-dismiss to not call destroyed object.

BUG=413744

Review URL: https://codereview.chromium.org/611543002

Cr-Commit-Position: refs/heads/master@{#296973}
parent 0f5b5790
......@@ -74,15 +74,22 @@ public class ImeAdapter {
}
private class DelayedDismissInput implements Runnable {
private final long mNativeImeAdapter;
private long mNativeImeAdapter;
DelayedDismissInput(long nativeImeAdapter) {
mNativeImeAdapter = nativeImeAdapter;
}
// http://crbug.com/413744
void detach() {
mNativeImeAdapter = 0;
}
@Override
public void run() {
attach(mNativeImeAdapter, sTextInputTypeNone, sTextInputFlagNone);
if (mNativeImeAdapter != 0) {
attach(mNativeImeAdapter, sTextInputTypeNone, sTextInputFlagNone);
}
dismissInput(true);
}
}
......@@ -693,7 +700,10 @@ public class ImeAdapter {
@CalledByNative
void detach() {
if (mDismissInput != null) mHandler.removeCallbacks(mDismissInput);
if (mDismissInput != null) {
mHandler.removeCallbacks(mDismissInput);
mDismissInput.detach();
}
mNativeImeAdapterAndroid = 0;
mTextInputType = 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment