SurfaceTexture: detachFromContext fixed

Fixed AttachToContextSucceeds test SurfaceTexture test by
not deleting the current texture when cleaning up memory.

Bug: 6363186
Change-Id: Ib886bfe6bb86e25ea4825d18b5008afba6b33eae
This commit is contained in:
Daniel Lam 2012-04-18 21:29:19 -07:00 committed by Mathias Agopian
parent 2488b20aec
commit f4b322801d

View File

@ -351,7 +351,7 @@ status_t SurfaceTexture::detachFromContext() {
// new EGLDisplay). // new EGLDisplay).
for (int i =0; i < BufferQueue::NUM_BUFFER_SLOTS; i++) { for (int i =0; i < BufferQueue::NUM_BUFFER_SLOTS; i++) {
EGLImageKHR img = mEGLSlots[i].mEglImage; EGLImageKHR img = mEGLSlots[i].mEglImage;
if (img != EGL_NO_IMAGE_KHR) { if (img != EGL_NO_IMAGE_KHR && i != mCurrentTexture) {
eglDestroyImageKHR(mEglDisplay, img); eglDestroyImageKHR(mEglDisplay, img);
mEGLSlots[i].mEglImage = EGL_NO_IMAGE_KHR; mEGLSlots[i].mEglImage = EGL_NO_IMAGE_KHR;
} }