Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33ea2ce9 authored by Christopher Ferris's avatar Christopher Ferris Committed by android-build-merger
Browse files

Merge "Fix use of invalid iterator." into nyc-dev

am: 44e9c027

* commit '44e9c027':
  Fix use of invalid iterator.

Change-Id: Ib49709f22ef73f29463ec2bb115ccb794c683db5
parents 96e4ffd4 44e9c027
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1280,11 +1280,14 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height,

                // freeBufferLocked puts this slot on the free slots list. Since
                // we then attached a buffer, move the slot to free buffer list.
                mCore->mFreeSlots.erase(slot);
                mCore->mFreeBuffers.push_front(*slot);

                BQ_LOGV("allocateBuffers: allocated a new buffer in slot %d",
                        *slot);

                // Make sure the erase is done after all uses of the slot
                // iterator since it will be invalid after this point.
                mCore->mFreeSlots.erase(slot);
            }

            mCore->mIsAllocating = false;