From 0bb2cfa95c3ca169059892fe78bf11747e56fb0f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 17 Aug 2021 21:21:14 +0200 Subject: video/ps3eye: add missing graceful exit This might fix LED problems. --- video-ps3eye/module.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video-ps3eye') diff --git a/video-ps3eye/module.cpp b/video-ps3eye/module.cpp index a7078180..cdc06974 100644 --- a/video-ps3eye/module.cpp +++ b/video-ps3eye/module.cpp @@ -132,6 +132,11 @@ void ps3eye_camera::stop() if (wrapper.state() != QProcess::NotRunning) { + volatile auto& ptr = *(ps3eye::shm*)shm.ptr(); + ptr.in.do_exit = 1; + std::atomic_thread_fence(std::memory_order_seq_cst); + wrapper.waitForFinished(5000); + if (wrapper.state() != QProcess::NotRunning) wrapper.kill(); wrapper.waitForFinished(1000); -- cgit v1.2.3