Actually shut down the old capture thread when stopping capture.

This commit is contained in:
dnaq 2021-09-23 14:20:10 +02:00
parent da46a02110
commit f65dbcb8d6

View file

@ -142,6 +142,7 @@ class HidMachine(ThreadedStenotypeBase):
keystate = BitString(N_BUTTONS)
def start_capture(self):
self.finished.clear()
self._initializing()
# Enumerate all hid devices on the machine and if we find one with our
# usage page and usage we try to connect to it.
@ -164,10 +165,10 @@ class HidMachine(ThreadedStenotypeBase):
self.start()
def stop_capture(self):
super().stop_capture()
if self._hid:
self._hid.close()
self._hid = None
self._stopped()
@classmethod
def get_option_info(cls):