Previusly, read error could happen before message_thread starts,
so do not attempt to join in that case.
Change-Id: Ie119916831e320e38eb02e48515b4c6a9cb937e5
Signed-off-by: Vratko Polak <[email protected]>
self.socket.close()
if self.sque is not None:
self.sque.put(True) # Terminate listening thread
- if self.message_thread is not None:
+ if self.message_thread is not None and self.message_thread.is_alive():
# Allow additional connect() calls.
self.message_thread.join()
# Collect garbage.