The Zeroconf object might already be closed after unregister_service

This commit is contained in:
Fabio Manganiello 2020-08-20 00:37:39 +02:00
parent 63ad4bfdce
commit ddedcd647c

View file

@ -365,7 +365,9 @@ class Backend(Thread, EventGenerator):
"""
if self.zeroconf and self.zeroconf_info:
self.zeroconf.unregister_service(self.zeroconf_info)
if self.zeroconf:
self.zeroconf.close()
self.bus.post(ZeroconfServiceRemovedEvent(service_type=self.zeroconf_info.type,
service_name=self.zeroconf_info.name))