SurfaceTexture: Fix a fence fd leak.

Bug: 6949010
Change-Id: I289992c964504b4fe5458dbd19b248a841ef043f
This commit is contained in:
Jamie Gennis 2012-08-08 15:39:55 -07:00
parent b685c54283
commit 3d1d09c0c1

View File

@ -327,9 +327,9 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) {
}
void SurfaceTexture::setReleaseFence(int fenceFd) {
sp<Fence> fence(new Fence(fenceFd));
if (fenceFd == -1 || mCurrentTexture == BufferQueue::INVALID_BUFFER_SLOT)
return;
sp<Fence> fence(new Fence(fenceFd));
if (!mEGLSlots[mCurrentTexture].mReleaseFence.get()) {
mEGLSlots[mCurrentTexture].mReleaseFence = fence;
} else {