From 8b0de29c416c81be2d98b73effe6c7315b1fc1e1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 5 Jan 2019 12:58:20 +0200 Subject: libcamera: camera_manager: Make the class a singleton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There can only be a single camera manager instance in the application. Creating it as a singleton helps avoiding mistakes. It also allows the camera manager to be used as a storage of global data, such as the future event dispatcher. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- test/list.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'test') diff --git a/test/list.cpp b/test/list.cpp index 39b8a41d..e2026c99 100644 --- a/test/list.cpp +++ b/test/list.cpp @@ -19,10 +19,7 @@ class ListTest : public Test protected: int init() { - cm = new CameraManager(); - if (!cm) - return -ENOMEM; - + cm = CameraManager::instance(); cm->start(); return 0; @@ -43,8 +40,6 @@ protected: void cleanup() { cm->stop(); - - delete cm; } private: -- cgit v1.2.1