From 3d1d09c0c116c42f7d083f87628b5f8377b1f275 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Wed, 8 Aug 2012 15:39:55 -0700 Subject: [PATCH] SurfaceTexture: Fix a fence fd leak. Bug: 6949010 Change-Id: I289992c964504b4fe5458dbd19b248a841ef043f --- 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 a2aca8f0e..66660810f 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -327,9 +327,9 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) { } void SurfaceTexture::setReleaseFence(int fenceFd) { + sp fence(new Fence(fenceFd)); if (fenceFd == -1 || mCurrentTexture == BufferQueue::INVALID_BUFFER_SLOT) return; - sp fence(new Fence(fenceFd)); if (!mEGLSlots[mCurrentTexture].mReleaseFence.get()) { mEGLSlots[mCurrentTexture].mReleaseFence = fence; } else {