diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-08-26 17:26:47 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-10-07 19:17:31 +0900 |
commit | 1469d5e26e27bf5fe4d065a6f3c87edd804f2888 (patch) | |
tree | 2ffd4611a917ef4f6a375609e607e749d04d65b2 /test | |
parent | 7e59bccb35015dea1a3ce6c50efb0cc23157060f (diff) |
libcamera: ProcessManager: make ProcessManager lifetime explicitly managed
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 <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/log/log_process.cpp | 2 | ||||
-rw-r--r-- | test/process/process_test.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp index b024f002..2a826222 100644 --- a/test/log/log_process.cpp +++ b/test/log/log_process.cpp @@ -132,6 +132,8 @@ private: exitCode_ = exitCode; } + ProcessManager processManager_; + Process proc_; Process::ExitStatus exitStatus_; string logPath_; 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_; |