[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.
This commit is contained in:
Jonah Williams 2025-02-12 12:49:48 -08:00 committed by GitHub
parent 3011859512
commit a7a4da95c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();