[libcamera-devel] [PATCH v1 2/2] pipeline: raspberrypi: Do not unconditionally free buffers on close
David Plowman
david.plowman at raspberrypi.com
Fri Oct 28 15:37:07 CEST 2022
Hi Naush
Thanks for the patch!
On Fri, 28 Oct 2022 at 12:52, Naushir Patuck via libcamera-devel
<libcamera-devel at lists.libcamera.org> wrote:
>
> When a camera is terminated, do not unconditionally free buffers in the
> RPiCameraData destructor. Otherwise, this causes harmless error log messages
> to be displayed if no buffer have previously been allocated.
>
> Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
All looks good!
Tested-by: David Plowman <david.plowman at raspberrypi.com>
Reviewed-by: David Plowman <david.plowman at raspberrypi.com>
Thanks
David
> ---
> src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index 343f8cb2c7ed..31107e1338bf 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -191,7 +191,8 @@ public:
>
> ~RPiCameraData()
> {
> - freeBuffers();
> + if (buffersAllocated_)
> + freeBuffers();
> }
>
> void freeBuffers();
> --
> 2.25.1
>
More information about the libcamera-devel
mailing list