<div dir="ltr"><div dir="ltr">Hi Kieran,<div><br></div><div>Thanks for the review.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 28 Oct 2022 at 14:46, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Quoting Naushir Patuck via libcamera-devel (2022-10-28 12:52:00)<br>
> When a camera is terminated, do not unconditionally free buffers in the<br>
> RPiCameraData destructor. Otherwise, this causes harmless error log messages<br>
> to be displayed if no buffer have previously been allocated.<br>
> <br>
<br>
Much like the V4L2 patch, I would think putting this check into<br>
the beginning of void RPiCameraData::freeBuffers() would be safer.<br>
<br>
I see freeBuffers is called a few times, (configure, start), which I<br>
presume already ensure they are allocated ... but catching this for sure<br>
for all cases could make sense.<br></blockquote><div><br></div><div>Agree, I'll make the update shortly. Again, I blame Friday!!</div><div><br></div><div>Naush</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Anyway, that's up to you, however you prefer:<br>
<br>
Reviewed-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com" target="_blank">kieran.bingham@ideasonboard.com</a>><br>
<br>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> ---<br>
> src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++-<br>
> 1 file changed, 2 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> index 343f8cb2c7ed..31107e1338bf 100644<br>
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> @@ -191,7 +191,8 @@ public:<br>
> <br>
> ~RPiCameraData()<br>
> {<br>
> - freeBuffers();<br>
> + if (buffersAllocated_)<br>
> + freeBuffers();<br>
> }<br>
> <br>
> void freeBuffers();<br>
> -- <br>
> 2.25.1<br>
><br>
</blockquote></div></div>