[PATCH] libcamera: delayed_controls: Inherit from Object class
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Feb 24 02:19:34 CET 2025
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 <laurent.pinchart at ideasonboard.com>
---
Stan, would you be able to test this with the simple pipeline handler ?
It should work both with and without your series that deals with the
frame start signal, and should fix the crash that Kieran has reported.
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 e8d3014d92cb..b64d8bba7cf7 100644
--- a/include/libcamera/internal/delayed_controls.h
+++ b/include/libcamera/internal/delayed_controls.h
@@ -10,13 +10,15 @@
#include <stdint.h>
#include <unordered_map>
+#include <libcamera/base/object.h>
+
#include <libcamera/controls.h>
namespace libcamera {
class V4L2Device;
-class DelayedControls
+class DelayedControls : public Object
{
public:
struct ControlParams {
base-commit: d476f8358be1536d4edd680c6024f784ff022f5d
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list