From afd9890b7b9a65d95ef3295f52e01e0ec9ce7b3f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 24 Feb 2025 03:19:34 +0200 Subject: [PATCH] libcamera: delayed_controls: Inherit from Object class A second use-after-free bug related to signals staying connected after the receiver DelayedControls instance gets deleted has been found, this time in the simple pipeline handler. Fix the issue once and for all by making the DelayedControls class inherit from Object. This will disconnect signals automatically upon deletion of the receiver. Signed-off-by: Laurent Pinchart Tested-by: Stanislaw Gruszka Tested-by: Isaac Scott Reviewed-by: Isaac Scott Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- include/libcamera/internal/delayed_controls.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h index e8d3014d9..b64d8bba7 100644 --- a/include/libcamera/internal/delayed_controls.h +++ b/include/libcamera/internal/delayed_controls.h @@ -10,13 +10,15 @@ #include #include +#include + #include namespace libcamera { class V4L2Device; -class DelayedControls +class DelayedControls : public Object { public: struct ControlParams {