hwc: Close acquireFenceFds always.
Close acquireFenceFds always even in case of failures if a layer is either
OVERLAY or FRAMEBUFFER_TARGET to prevent leaks in case of failures.
The framework is *not* responsible for closing acquire fds, for layers
marked as above two.
Change-Id: Ia6c751d3ec25f196f5503120894fc6cc692b9d25
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 519126f..c2688b5 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -343,9 +343,11 @@
}
if (ctx->mFbDev->post(ctx->mFbDev, fbLayer->handle)) {
ALOGE("%s: ctx->mFbDev->post fail!", __FUNCTION__);
- return -1;
+ ret = -1;
}
}
+
+ closeAcquireFds(list);
return ret;
}
@@ -382,9 +384,11 @@
}
if (!ctx->mExtDisplay->post()) {
ALOGE("%s: ctx->mExtDisplay->post fail!", __FUNCTION__);
- return -1;
+ ret = -1;
}
}
+
+ closeAcquireFds(list);
return ret;
}