Fix NPE in TextureView
am: 3c2587f26e
Change-Id: I79f35e5029cb3abb5fa74a60e448cd09835e2112
This commit is contained in:
@@ -242,21 +242,23 @@ public class TextureView extends View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void releaseSurfaceTexture() {
|
private void releaseSurfaceTexture() {
|
||||||
boolean shouldRelease = true;
|
if (mSurface != null) {
|
||||||
|
boolean shouldRelease = true;
|
||||||
|
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
shouldRelease = mListener.onSurfaceTextureDestroyed(mSurface);
|
shouldRelease = mListener.onSurfaceTextureDestroyed(mSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (mNativeWindowLock) {
|
synchronized (mNativeWindowLock) {
|
||||||
nDestroyNativeWindow();
|
nDestroyNativeWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldRelease) {
|
if (shouldRelease) {
|
||||||
mSurface.release();
|
mSurface.release();
|
||||||
|
}
|
||||||
|
mSurface = null;
|
||||||
|
mHadSurface = true;
|
||||||
}
|
}
|
||||||
mSurface = null;
|
|
||||||
mHadSurface = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user