From 21ff749a790386f87e767a690c77948a6474ceaa Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 17 Jan 2019 16:23:25 +0200 Subject: libcamera: camera: Handle camera objects through shared pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Camera class is explicitly reference-counted to manage the lifetime of camera objects. Replace this open-coded implementation with usage of the std::shared_ptr<> class. This API change prevents pipeline handlers from subclassing the Camera class. This isn't deemed to be an issue. Mark the class final to make this explicit. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- test/list-cameras.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/list-cameras.cpp') diff --git a/test/list-cameras.cpp b/test/list-cameras.cpp index fdbbda09..070cbf2b 100644 --- a/test/list-cameras.cpp +++ b/test/list-cameras.cpp @@ -30,7 +30,7 @@ protected: { unsigned int count = 0; - for (Camera *camera : cm->cameras()) { + for (const std::shared_ptr &camera : cm->cameras()) { cout << "- " << camera->name() << endl; count++; } -- cgit v1.2.1