From 5cf072a9c77a77fddaae2a14e64a6a47a22b4d34 Mon Sep 17 00:00:00 2001 From: Stefan Bethge Date: Mon, 25 Sep 2006 20:26:20 +0000 Subject: [PATCH] properly disconnect from dbus when calling disconnect() --- src/common/zeroconf/zeroconf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/zeroconf/zeroconf.py b/src/common/zeroconf/zeroconf.py index 1c4c3b7d1..d4a13341d 100755 --- a/src/common/zeroconf/zeroconf.py +++ b/src/common/zeroconf/zeroconf.py @@ -72,9 +72,9 @@ class Zeroconf: reply_handler=self.service_resolved_callback, error_handler=self.print_error_callback) def remove_service_callback(self, interface, protocol, name, stype, domain, flags): - # print "Service '%s' in domain '%s' on %i.%i disappeared." % (name, domain, interface, protocol) - if not self.connected: - return + print "Service '%s' in domain '%s' on %i.%i disappeared." % (name, domain, interface, protocol) + #if not self.connected: + # return if name != self.name: for key in self.contacts.keys(): if self.contacts[key][C_BARE_NAME] == name: @@ -286,6 +286,8 @@ class Zeroconf: def disconnect(self): if self.connected: self.connected = False + self.service_browser.Free() + self.service_browser = None self.remove_announce() # refresh txt data of all contacts manually (no callback available)