fix soundLib thread cleanup when no threads started

This commit is contained in:
petrucci4prez 2017-06-24 00:47:54 -04:00
parent 501577d153
commit d8c897db5c
1 changed files with 5 additions and 2 deletions

View File

@ -226,8 +226,11 @@ class SoundLib:
def _stopMonitor(self): def _stopMonitor(self):
self._stopper.set() self._stopper.set()
self._ttsQueue.put_nowait(self._sentinel) self._ttsQueue.put_nowait(self._sentinel)
try:
self._thread.join() self._thread.join()
self._thread = None self._thread = None
except AttributeError:
pass
logger.debug('Stopping TTS Queue Monitor') logger.debug('Stopping TTS Queue Monitor')
def __del__(self): def __del__(self):