Fix ordering of stop statements to prevent exception

pull/10/head
Matthew D. Scholefield 2018-03-27 14:14:47 -05:00
parent ef067fe1a4
commit 0b80a25ea7
1 changed files with 2 additions and 2 deletions

View File

@ -147,13 +147,13 @@ class PreciseRunner:
def stop(self):
"""Stop listening and close stream"""
self.engine.stop()
if self.thread:
self.running = False
self.thread.join()
self.thread = None
self.engine.stop()
if self.pa:
self.pa.terminate()
self.stream.stop_stream()