From 30d704732badc675f72fe73d14749669cb645c23 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 28 Oct 2022 14:51:10 +0100 Subject: pipeline: raspberrypi: Do not unconditionally free buffers on close 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 Tested-by: David Plowman Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libcamera/pipeline/raspberrypi/raspberrypi.cpp') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 343f8cb2..1b599fcc 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1506,6 +1506,9 @@ void PipelineHandlerRPi::mapBuffers(Camera *camera, const RPi::BufferMap &buffer void RPiCameraData::freeBuffers() { + if (!buffersAllocated_) + return; + if (ipa_) { /* * Copy the buffer ids from the unordered_set to a vector to -- cgit v1.2.1