summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/module.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-08-17 21:21:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-08-18 08:33:40 +0200
commit0bb2cfa95c3ca169059892fe78bf11747e56fb0f (patch)
tree7a54be29b5d6aba7f5009ab1942d3f83bc39cbf8 /video-ps3eye/module.cpp
parent6795178b3f5a1daff130e374e5046ce75c55c1ce (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.cpp5
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);