aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2022-11-02 11:51:58 +0100
committerThéo de la Hogue2022-11-02 11:51:58 +0100
commit4535c7e57492a9d9ba4ddf3c1767fe85c3e4c2bc (patch)
treecd829ab60aaaa94bd59841101317348d557040ee /src
parent9a9c07758cbf368fec558656d70f3bfadbb1cc95 (diff)
downloadargaze-4535c7e57492a9d9ba4ddf3c1767fe85c3e4c2bc.zip
argaze-4535c7e57492a9d9ba4ddf3c1767fe85c3e4c2bc.tar.gz
argaze-4535c7e57492a9d9ba4ddf3c1767fe85c3e4c2bc.tar.bz2
argaze-4535c7e57492a9d9ba4ddf3c1767fe85c3e4c2bc.tar.xz
Closing thread if is alive.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/TobiiGlassesPro2/TobiiData.py4
-rw-r--r--src/argaze/TobiiGlassesPro2/TobiiVideo.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/argaze/TobiiGlassesPro2/TobiiData.py b/src/argaze/TobiiGlassesPro2/TobiiData.py
index 903dcc7..95fa947 100644
--- a/src/argaze/TobiiGlassesPro2/TobiiData.py
+++ b/src/argaze/TobiiGlassesPro2/TobiiData.py
@@ -315,7 +315,9 @@ class TobiiDataStream(threading.Thread):
def __del__(self):
"""Stop data reception before destruction."""
- self.close()
+ if self.is_alive():
+
+ self.close()
def __keep_alive(self):
"""Maintain connection."""
diff --git a/src/argaze/TobiiGlassesPro2/TobiiVideo.py b/src/argaze/TobiiGlassesPro2/TobiiVideo.py
index c7901f3..82ee429 100644
--- a/src/argaze/TobiiGlassesPro2/TobiiVideo.py
+++ b/src/argaze/TobiiGlassesPro2/TobiiVideo.py
@@ -152,7 +152,9 @@ class TobiiVideoStream(threading.Thread):
def __del__(self):
"""Stop data reception before destruction."""
- self.close()
+ if self.is_alive():
+
+ self.close()
def __keep_alive(self):
"""Maintain connection."""