Skip to content

Commit bc0b47e

Browse files
committed
wait for the termination of the threads before closing the sockets. this prevent the threads from using closed sockets.
1 parent 0b9093d commit bc0b47e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

zeroconf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ def enqueue_callback(state_change, name):
10381038
def cancel(self):
10391039
self.done = True
10401040
self.zc.notify_all()
1041+
self.join()
10411042

10421043
def run(self):
10431044
while True:
@@ -1675,5 +1676,7 @@ def close(self):
16751676
self.notify_all()
16761677
self.engine.notify()
16771678
self.unregister_all_services()
1679+
self.reaper.join()
1680+
self.engine.join()
16781681
for s in [self._listen_socket] + self._respond_sockets:
16791682
s.close()

0 commit comments

Comments
 (0)