diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-17 21:21:14 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-18 08:33:40 +0200 |
commit | 0bb2cfa95c3ca169059892fe78bf11747e56fb0f (patch) | |
tree | 7a54be29b5d6aba7f5009ab1942d3f83bc39cbf8 /video-ps3eye/module.cpp | |
parent | 6795178b3f5a1daff130e374e5046ce75c55c1ce (diff) |
video/ps3eye: add missing graceful exit
This might fix LED problems.
Diffstat (limited to 'video-ps3eye/module.cpp')
-rw-r--r-- | video-ps3eye/module.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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); |