Fix NPE in TextureView

Bug: 30651595
Change-Id: Ic6cc2a1598de173aaadb4061562236a563a662b3
This commit is contained in:
John Reck
2016-08-04 07:55:38 -07:00
parent 8437fce56d
commit 3c2587f26e

View File

@@ -242,6 +242,7 @@ public class TextureView extends View {
} }
private void releaseSurfaceTexture() { private void releaseSurfaceTexture() {
if (mSurface != null) {
boolean shouldRelease = true; boolean shouldRelease = true;
if (mListener != null) { if (mListener != null) {
@@ -258,6 +259,7 @@ public class TextureView extends View {
mSurface = null; mSurface = null;
mHadSurface = true; mHadSurface = true;
} }
}
/** /**
* The layer type of a TextureView is ignored since a TextureView is always * The layer type of a TextureView is ignored since a TextureView is always