[libcamera-devel] [PATCH v2 01/16] libcamera: camera: Don't move buffers away from request at completion
Niklas Söderlund
niklas.soderlund at ragnatech.se
Sun Jul 14 09:06:13 CEST 2019
Hi Laurent,
Thanks for your patch.
On 2019-07-13 20:23:36 +0300, Laurent Pinchart wrote:
> 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 at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/libcamera/camera.cpp | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index 592dfd39eacc..094f1b63b7f1 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;
> }
>
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list