summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2011-09-25 17:56:28 +0200
committerMichael Albinus <michael.albinus@gmx.de>2011-09-25 17:56:28 +0200
commite2ee6f30ac4e3933cda1f09f74196e98d43d1d6a (patch)
treefc7ed41f324a5dfd00da8a3eeecb91f8323485cf
parented6235ea178e237f091e55e662d0b477a9399870 (diff)
downloademacs-e2ee6f30ac4e3933cda1f09f74196e98d43d1d6a.tar.gz
* net/dbus.el (dbus-unregister-object): Don't release services for
registered signals. (Bug#9581)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/dbus.el22
2 files changed, 17 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 086b6c5b230..92324036dc5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-25 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/dbus.el (dbus-unregister-object): Don't release services for
+ registered signals. (Bug#9581)
+
2011-09-25 Teodor Zlatanov <tzz@lifelogs.com>
* progmodes/cfengine.el (cfengine-auto-mode): Add convenience
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index cbf9fe6ed86..ba7d7115ffc 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -140,11 +140,14 @@ association to the service from D-Bus."
;; Find the corresponding entry in the hash table.
(let* ((key (car object))
- (value (cdr object))
+ (value (cadr object))
+ (bus (car key))
+ (service (car value))
(entry (gethash key dbus-registered-objects-table))
ret)
+ ;; key has the structure (BUS INTERRFACE MEMBER).
+ ;; value has the structure (SERVICE PATH [HANDLER]).
;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...).
- ;; value has the structure ((SERVICE PATH [HANDLER]) ...).
;; MEMBER is either a string (the handler), or a cons cell (a
;; property value). UNAME and property values are not taken into
;; account for comparision.
@@ -152,8 +155,8 @@ association to the service from D-Bus."
;; Loop over the registered functions.
(dolist (elt entry)
(when (equal
- (car value)
- (butlast (cdr elt) (- (length (cdr elt)) (length (car value)))))
+ value
+ (butlast (cdr elt) (- (length (cdr elt)) (length value))))
(setq ret t)
;; Compute new hash value. If it is empty, remove it from the
;; hash table.
@@ -162,17 +165,16 @@ association to the service from D-Bus."
;; Remove match rule of signals.
(let ((rule (nth 4 elt)))
(when (stringp rule)
+ (setq service nil) ; We do not need to unregister the service.
(dbus-call-method
- (car key) dbus-service-dbus dbus-path-dbus dbus-interface-dbus
+ bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus
"RemoveMatch" rule)))))
;; Check, whether there is still a registered function or property
;; for the given service. If not, unregister the service from the
;; bus.
- (dolist (elt entry)
- (let ((service (cadr elt))
- (bus (car key))
- found)
- (when service
+ (when service
+ (dolist (elt entry)
+ (let (found)
(maphash
(lambda (k v)
(dolist (e v)