From 1469d5e26e27bf5fe4d065a6f3c87edd804f2888 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Wed, 26 Aug 2020 17:26:47 +0900 Subject: libcamera: ProcessManager: make ProcessManager lifetime explicitly managed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If any Process instances are destroyed after the ProcessManager is destroyed, then a segfault will occur. Fix this by making the lifetime of the ProcessManager explicit, and make the CameraManager construct and deconstruct (automatically, via a member variable) the ProcessManager. Update the tests accordingly. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- test/process/process_test.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/process') diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp index 42a26749..a3eaef80 100644 --- a/test/process/process_test.cpp +++ b/test/process/process_test.cpp @@ -87,6 +87,8 @@ private: exitCode_ = exitCode; } + ProcessManager processManager_; + Process proc_; enum Process::ExitStatus exitStatus_; int exitCode_; -- cgit v1.2.1