summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceTexture.cpp
diff options
context:
space:
mode:
authorDaniel Lam <dalam@google.com>2012-04-18 21:29:19 -0700
committerMathias Agopian <mathias@google.com>2012-04-24 17:25:00 -0700
commitf4b322801d872b64f6c7dd2d2ffc1e4f8e993eef (patch)
tree075064dca4cbee6bf868c1a3cd0e466810771959 /libs/gui/SurfaceTexture.cpp
parent2488b20aec097accb20a853d9876bb0a5dc04636 (diff)
downloadframeworks_native-f4b322801d872b64f6c7dd2d2ffc1e4f8e993eef.zip
frameworks_native-f4b322801d872b64f6c7dd2d2ffc1e4f8e993eef.tar.gz
frameworks_native-f4b322801d872b64f6c7dd2d2ffc1e4f8e993eef.tar.bz2
SurfaceTexture: detachFromContext fixed
Fixed AttachToContextSucceeds test SurfaceTexture test by not deleting the current texture when cleaning up memory. Bug: 6363186 Change-Id: Ib886bfe6bb86e25ea4825d18b5008afba6b33eae
Diffstat (limited to 'libs/gui/SurfaceTexture.cpp')
-rw-r--r--libs/gui/SurfaceTexture.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 6562a94..8141227 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -351,7 +351,7 @@ status_t SurfaceTexture::detachFromContext() {
// new EGLDisplay).
for (int i =0; i < BufferQueue::NUM_BUFFER_SLOTS; i++) {
EGLImageKHR img = mEGLSlots[i].mEglImage;
- if (img != EGL_NO_IMAGE_KHR) {
+ if (img != EGL_NO_IMAGE_KHR && i != mCurrentTexture) {
eglDestroyImageKHR(mEglDisplay, img);
mEGLSlots[i].mEglImage = EGL_NO_IMAGE_KHR;
}