summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java')
-rw-r--r--src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
index a04313b8b..dd9b7ce1f 100644
--- a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
+++ b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java
@@ -57,6 +57,13 @@ public abstract class SurfaceTextureScreenNail implements ScreenNail,
}
}
+ @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH)
+ private static void releaseSurfaceTexture(SurfaceTexture st) {
+ if (ApiHelper.HAS_RELEASE_SURFACE_TEXTURE) {
+ st.release();
+ }
+ }
+
public SurfaceTexture getSurfaceTexture() {
return mSurfaceTexture;
}
@@ -67,7 +74,7 @@ public abstract class SurfaceTextureScreenNail implements ScreenNail,
}
mExtTexture.recycle();
mExtTexture = null;
- mSurfaceTexture.release();
+ releaseSurfaceTexture(mSurfaceTexture);
mSurfaceTexture = null;
}