Fix NPE in TextureView am: 3c2587f26e

am: 8fe31ec0e0

Change-Id: I1f36262f8c09b4d75910bd5b3943b0931f57f477
This commit is contained in:
John Reck
2016-08-04 16:49:04 +00:00
committed by android-build-merger

View File

@@ -242,21 +242,23 @@ public class TextureView extends View {
}
private void releaseSurfaceTexture() {
boolean shouldRelease = true;
if (mSurface != null) {
boolean shouldRelease = true;
if (mListener != null) {
shouldRelease = mListener.onSurfaceTextureDestroyed(mSurface);
}
if (mListener != null) {
shouldRelease = mListener.onSurfaceTextureDestroyed(mSurface);
}
synchronized (mNativeWindowLock) {
nDestroyNativeWindow();
}
synchronized (mNativeWindowLock) {
nDestroyNativeWindow();
}
if (shouldRelease) {
mSurface.release();
if (shouldRelease) {
mSurface.release();
}
mSurface = null;
mHadSurface = true;
}
mSurface = null;
mHadSurface = true;
}
/**