summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-09-20 14:09:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-20 14:09:08 -0700
commit37bd30bfd59a352452aea474ece764a6a14f71a9 (patch)
treee74bf9732b622ed8ee594f223f39619f319c468b /include
parent813601785f9ef37f892034a7722d176deea41eec (diff)
parent9bd8dd3b13a0d690c9316ed31be7c9a13f3f439f (diff)
downloadsystem_core-37bd30bfd59a352452aea474ece764a6a14f71a9.zip
system_core-37bd30bfd59a352452aea474ece764a6a14f71a9.tar.gz
system_core-37bd30bfd59a352452aea474ece764a6a14f71a9.tar.bz2
Merge "ANW: fix an fd leak" into jb-mr1-dev
Diffstat (limited to 'include')
-rw-r--r--include/system/window.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/system/window.h b/include/system/window.h
index 685e068..1e7f114 100644
--- a/include/system/window.h
+++ b/include/system/window.h
@@ -828,9 +828,8 @@ static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw,
int err = anw->dequeueBuffer(anw, anb, &fenceFd);
if (err == 0 && fenceFd != -1) {
err = sync_wait(fenceFd, UINT_MAX);
- if (err == 0) {
- close(fenceFd);
- } else {
+ close(fenceFd);
+ if (err != 0) {
anw->cancelBuffer(anw, *anb, fenceFd);
*anb = NULL;
}