From a7a4da95c9f857eccb3efa5ca9498ee7ca060d93 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 12 Feb 2025 12:49:48 -0800 Subject: [PATCH] [Android] increment shared_ptr for jni impl. (#163152) More speculative fixes for crashing. Since we were closing over a ref, maybe it is nullptr? Lets check with an FML_CHECK too. --- .../shell/platform/android/android_surface_vk_impeller.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/android/android_surface_vk_impeller.cc b/engine/src/flutter/shell/platform/android/android_surface_vk_impeller.cc index 780d3f00671..2ecea59723f 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_vk_impeller.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_vk_impeller.cc @@ -95,7 +95,8 @@ bool AndroidSurfaceVKImpeller::SetNativeWindow( return false; } - impeller::CreateTransactionCB cb = [jni_facade]() { + impeller::CreateTransactionCB cb = [jni_facade = jni_facade]() { + FML_CHECK(jni_facade) << "JNI was nullptr"; ASurfaceTransaction* tx = jni_facade->createTransaction(); if (tx == nullptr) { return impeller::android::SurfaceTransaction();