diff options
author | Théo de la Hogue | 2022-11-02 11:51:58 +0100 |
---|---|---|
committer | Théo de la Hogue | 2022-11-02 11:51:58 +0100 |
commit | 4535c7e57492a9d9ba4ddf3c1767fe85c3e4c2bc (patch) | |
tree | cd829ab60aaaa94bd59841101317348d557040ee /src | |
parent | 9a9c07758cbf368fec558656d70f3bfadbb1cc95 (diff) | |
download | argaze-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.py | 4 | ||||
-rw-r--r-- | src/argaze/TobiiGlassesPro2/TobiiVideo.py | 4 |
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.""" |