Index: content/browser/renderer_host/render_widget_host_view_aura.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc |
index 261278f41e864312101a6f23f7748481b62ed215..8e4de004c9afae707a269e09133304e642f1831d 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
@@ -2464,6 +2464,13 @@ void RenderWidgetHostViewAura::OnWindowDestroying() { |
LPARAM lparam = reinterpret_cast<LPARAM>(this); |
EnumChildWindows(parent, WindowDestroyingCallback, lparam); |
#endif |
+ |
+ // Make sure that the input method no longer references to this object before |
+ // this object is removed from the root window (i.e. this object loses access |
+ // to the input method). |
+ ui::InputMethod* input_method = GetInputMethod(); |
+ if (input_method) |
+ input_method->DetachTextInputClient(this); |
} |
void RenderWidgetHostViewAura::OnWindowDestroyed() { |