libcamera: request: addBuffer(): Do not destroy fence on failure

Take the unique pointer to the `Fence` object by rvalue reference
so that it is not destroyed if the function returns an error code
and does not take ownership of the unique pointer.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2025-09-16 17:48:46 +02:00
parent 49439d6de5
commit 0e096da4b4
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ public:
ControlList &metadata() { return *metadata_; }
const BufferMap &buffers() const { return bufferMap_; }
int addBuffer(const Stream *stream, FrameBuffer *buffer,
std::unique_ptr<Fence> fence = nullptr);
std::unique_ptr<Fence> &&fence = {});
FrameBuffer *findBuffer(const Stream *stream) const;
uint32_t sequence() const;