Message ID | 20190713172351.25452-2-laurent.pinchart@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
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@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@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@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
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; }
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> --- src/libcamera/camera.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)