Prevent a race between SurfaceTexture.release and attachToGLContext (flutter/engine#27884)

This commit is contained in:
ColdPaleLight
2021-08-06 04:15:02 +08:00
committed by GitHub
parent 0620217342
commit 396f7190b9

View File

@@ -52,7 +52,11 @@ public class SurfaceTextureWrapper {
// Called by native.
@SuppressWarnings("unused")
public void attachToGLContext(int texName) {
surfaceTexture.attachToGLContext(texName);
synchronized (this) {
if (!released) {
surfaceTexture.attachToGLContext(texName);
}
}
}
// Called by native.