summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-09 22:03:54 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-14 16:00:38 +0300
commite8e80bfa8d6421057ad145f93659309586e1200f (patch)
tree919cdcc08d41ef269c14cf8728f401e48fd14058
parentc4b9ccb45a9f9a47e252d1ce4b5d55211a22a389 (diff)
libcamera: camera: Don't move buffers away from request at completion
For a historical reason that isn't fully understood, the request completion handler in the Camera class moves all buffers away from the request's buffer map to a local variable before emitting the request completion signal. There's no reason to do so, and it makes it impossible for requests to access buffers in their destructor. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--src/libcamera/camera.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index 592dfd39..094f1b63 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -894,8 +894,7 @@ int Camera::stop()
*/
void Camera::requestComplete(Request *request)
{
- std::map<Stream *, Buffer *> buffers(std::move(request->bufferMap_));
- requestCompleted.emit(request, buffers);
+ requestCompleted.emit(request, request->bufferMap_);
delete request;
}