From ddedcd647cf51a9788303cbab9fab3b2526f08dc Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 20 Aug 2020 00:37:39 +0200 Subject: [PATCH] The Zeroconf object might already be closed after unregister_service --- platypush/backend/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/backend/__init__.py b/platypush/backend/__init__.py index d8a9815ed..ddd28d7ea 100644 --- a/platypush/backend/__init__.py +++ b/platypush/backend/__init__.py @@ -365,7 +365,9 @@ class Backend(Thread, EventGenerator): """ if self.zeroconf and self.zeroconf_info: self.zeroconf.unregister_service(self.zeroconf_info) - self.zeroconf.close() + if self.zeroconf: + self.zeroconf.close() + self.bus.post(ZeroconfServiceRemovedEvent(service_type=self.zeroconf_info.type, service_name=self.zeroconf_info.name))