libcamera: framebuffer_allocator: Remove entry if allocation fails

Remove the entry from the `buffers_` mapping if
`Camera::exportFrameBuffers()` fails, otherwise
there would be a stale entry in the map.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze 2024-03-10 14:30:43 +00:00 committed by Kieran Bingham
parent ab5816a540
commit 2e2ba223f3

View file

@ -97,6 +97,10 @@ int FrameBufferAllocator::allocate(Stream *stream)
LOG(Allocator, Error)
<< "Stream is not part of " << camera_->id()
<< " active configuration";
if (ret < 0)
buffers_.erase(it);
return ret;
}