Fix NullPointerException in SurfaceTextureRegistryEntry (flutter/engine#7837)

This commit is contained in:
najeira
2019-02-16 06:01:41 +09:00
committed by Jason Simmons
parent a3e6ae8948
commit cd5ceb29be

View File

@@ -1102,7 +1102,7 @@ public class FlutterView extends SurfaceView
private SurfaceTexture.OnFrameAvailableListener onFrameListener = new SurfaceTexture.OnFrameAvailableListener() {
@Override
public void onFrameAvailable(SurfaceTexture texture) {
if (released) {
if (released || mNativeView == null) {
// Even though we make sure to unregister the callback before releasing, as of Android O
// SurfaceTexture has a data race when accessing the callback, so the callback may
// still be called by a stale reference after released==true and mNativeView==null.