Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: components/spellcheck/browser/spellcheck_message_filter_platform_android.cc

Issue 2384613002: [Android] Fix spellcheck JNI crash when a tab is closed. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
diff --git a/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc b/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
index 50a0e5a2d9b7b750ba7639e915a6a7847687b18c..0e25c864657bf5ce258f50d05dc01f18f075159b 100644
--- a/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
+++ b/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
@@ -91,3 +91,9 @@ void SpellCheckMessageFilterPlatform::OnToggleSpellCheck(
if (!enabled)
impl_->DisconnectSession();
}
+
+void SpellCheckMessageFilterPlatform::OnDestruct() const {
+ // Needs to be destroyed on the UI thread, to avoid race conditions
+ // on the java side during clean-up.
+ BrowserThread::DeleteOnUIThread::Destruct(this);
+}

Powered by Google App Engine
This is Rietveld 408576698