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

Commit dce5c559 authored by Pablo Ceballos's avatar Pablo Ceballos
Browse files

BQ: Fix iterator use

Don't use an iterator after it's been removed from the container.

Change-Id: I374b454bba95d10dcec6a600bf8f16e5636e426b
parent c5cec281
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -222,9 +222,9 @@ int BufferQueueProducer::getFreeSlotLocked() const {
    if (mCore->mFreeSlots.empty()) {
        return BufferQueueCore::INVALID_BUFFER_SLOT;
    }
    auto slot = mCore->mFreeSlots.begin();
    int slot = *(mCore->mFreeSlots.begin());
    mCore->mFreeSlots.erase(slot);
    return *slot;
    return slot;
}

status_t BufferQueueProducer::waitForFreeSlotThenRelock(FreeSlotCaller caller,