summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/gui/BufferQueueProducer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index 7ca92b77bf..4212e4c27a 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -509,11 +509,15 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
mCore->mIsAllocatingCondition.broadcast();
if (graphicBuffer == NULL) {
+ mCore->mFreeSlots.insert(*outSlot);
+ mCore->clearBufferSlotLocked(*outSlot);
BQ_LOGE("dequeueBuffer: createGraphicBuffer failed");
return error;
}
if (mCore->mIsAbandoned) {
+ mCore->mFreeSlots.insert(*outSlot);
+ mCore->clearBufferSlotLocked(*outSlot);
BQ_LOGE("dequeueBuffer: BufferQueue has been abandoned");
return NO_INIT;
}