From e7db724bed5d1e5086801df7705d9b1f2a071785 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Tue, 3 Jul 2012 13:41:54 -0700 Subject: [PATCH] Fix check for fence merge success Change-Id: I9b16526ebfe4ffabf7c4372cca9b192ce046aa21 --- libs/gui/SurfaceTexture.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 9c76e6e78..ed6b73e20 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -338,14 +338,14 @@ void SurfaceTexture::setReleaseFence(int fenceFd) { sp mergedFence = Fence::merge( String8("SurfaceTexture merged release"), mEGLSlots[mCurrentTexture].mReleaseFence, fence); - if (mergedFence.get()) { + if (!mergedFence.get()) { ALOGE("failed to merge release fences"); // synchronization is broken, the best we can do is hope fences // signal in order so the new fence will act like a union mEGLSlots[mCurrentTexture].mReleaseFence = fence; - } else { - mEGLSlots[mCurrentTexture].mReleaseFence = mergedFence; + return; } + mEGLSlots[mCurrentTexture].mReleaseFence = mergedFence; } }