From f4b322801d872b64f6c7dd2d2ffc1e4f8e993eef Mon Sep 17 00:00:00 2001 From: Daniel Lam Date: Wed, 18 Apr 2012 21:29:19 -0700 Subject: [PATCH] SurfaceTexture: detachFromContext fixed Fixed AttachToContextSucceeds test SurfaceTexture test by not deleting the current texture when cleaning up memory. Bug: 6363186 Change-Id: Ib886bfe6bb86e25ea4825d18b5008afba6b33eae --- libs/gui/SurfaceTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 6562a94bb..8141227f8 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; }