[libcamera-devel] [PATCH v4 1/5] HACK: libcamera: Camera public destructor

Tomi Valkeinen tomi.valkeinen at ideasonboard.com
Fri Feb 4 14:38:10 CET 2022


pybind11 needs a public destructor for Camera to be able to manage the
shared_ptr. It's not clear why this is needed, and can it be fixed in
pybind11.

Looks like there's a suggested fix, which has not been merged:

https://github.com/pybind/pybind11/pull/2067

Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
---
 include/libcamera/camera.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
index 5bb06584..e753cd23 100644
--- a/include/libcamera/camera.h
+++ b/include/libcamera/camera.h
@@ -114,12 +114,12 @@ public:
 	int start(const ControlList *controls = nullptr);
 	int stop();
 
+	~Camera();
 private:
 	LIBCAMERA_DISABLE_COPY(Camera)
 
 	Camera(std::unique_ptr<Private> d, const std::string &id,
 	       const std::set<Stream *> &streams);
-	~Camera();
 
 	friend class PipelineHandler;
 	void disconnect();
-- 
2.25.1



More information about the libcamera-devel mailing list