diff --git a/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_payment_method_controller.cc b/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_payment_method_controller.cc index 890b000f21809..80a5fd506ee60 100644 --- a/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_payment_method_controller.cc +++ b/chrome/browser/touch_to_fill/autofill/android/touch_to_fill_payment_method_controller.cc @@ -61,6 +61,9 @@ TouchToFillPaymentMethodController::~TouchToFillPaymentMethodController() { void TouchToFillPaymentMethodController::WebContentsDestroyed() { Hide(); + Java_TouchToFillPaymentMethodControllerBridge_onNativeDestroyed( + base::android::AttachCurrentThread(), java_object_); + java_object_.Reset(); } void TouchToFillPaymentMethodController::DidFinishNavigation( @@ -146,8 +149,7 @@ void TouchToFillPaymentMethodController::OnDismissed(JNIEnv* env, delegate_->OnDismissed(dismissed_by_user); } view_.reset(); - delegate_.reset(); - java_object_.Reset(); + delegate_.reset(); keyboard_suppressor_.Unsuppress(); }