Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4d5d0b0

Browse files
committed
Add check and fix doics
1 parent 110a579 commit 4d5d0b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ final class SurfaceTextureRegistryEntry implements TextureRegistry.SurfaceTextur
131131
new SurfaceTexture.OnFrameAvailableListener() {
132132
@Override
133133
public void onFrameAvailable(@NonNull SurfaceTexture texture) {
134-
if (released) {
135-
// Even though we make sure to unregister the callback before releasing, as of Android
136-
// O
137-
// SurfaceTexture has a data race when accessing the callback, so the callback may
138-
// still be called by a stale reference after released==true and mNativeView==null.
134+
if (released || !flutterJNI.isAttached()) {
135+
// Even though we make sure to unregister the callback before releasing, as of
136+
// Android O, SurfaceTexture has a data race when accessing the callback, so the
137+
// callback may still be called by a stale reference after released==true and
138+
// mNativeView==null.
139139
return;
140140
}
141141
markTextureFrameAvailable(id);

0 commit comments

Comments
 (0)