diff options
| author | Michael Albinus | 2011-09-25 17:56:28 +0200 |
|---|---|---|
| committer | Michael Albinus | 2011-09-25 17:56:28 +0200 |
| commit | e2ee6f30ac4e3933cda1f09f74196e98d43d1d6a (patch) | |
| tree | fc7ed41f324a5dfd00da8a3eeecb91f8323485cf | |
| parent | ed6235ea178e237f091e55e662d0b477a9399870 (diff) | |
| download | emacs-e2ee6f30ac4e3933cda1f09f74196e98d43d1d6a.tar.gz emacs-e2ee6f30ac4e3933cda1f09f74196e98d43d1d6a.zip | |
* net/dbus.el (dbus-unregister-object): Don't release services for
registered signals. (Bug#9581)
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/dbus.el | 22 |
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 @@ | |||
| 1 | 2011-09-25 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/dbus.el (dbus-unregister-object): Don't release services for | ||
| 4 | registered signals. (Bug#9581) | ||
| 5 | |||
| 1 | 2011-09-25 Teodor Zlatanov <tzz@lifelogs.com> | 6 | 2011-09-25 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 7 | ||
| 3 | * progmodes/cfengine.el (cfengine-auto-mode): Add convenience | 8 | * 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." | |||
| 140 | 140 | ||
| 141 | ;; Find the corresponding entry in the hash table. | 141 | ;; Find the corresponding entry in the hash table. |
| 142 | (let* ((key (car object)) | 142 | (let* ((key (car object)) |
| 143 | (value (cdr object)) | 143 | (value (cadr object)) |
| 144 | (bus (car key)) | ||
| 145 | (service (car value)) | ||
| 144 | (entry (gethash key dbus-registered-objects-table)) | 146 | (entry (gethash key dbus-registered-objects-table)) |
| 145 | ret) | 147 | ret) |
| 148 | ;; key has the structure (BUS INTERRFACE MEMBER). | ||
| 149 | ;; value has the structure (SERVICE PATH [HANDLER]). | ||
| 146 | ;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...). | 150 | ;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...). |
| 147 | ;; value has the structure ((SERVICE PATH [HANDLER]) ...). | ||
| 148 | ;; MEMBER is either a string (the handler), or a cons cell (a | 151 | ;; MEMBER is either a string (the handler), or a cons cell (a |
| 149 | ;; property value). UNAME and property values are not taken into | 152 | ;; property value). UNAME and property values are not taken into |
| 150 | ;; account for comparision. | 153 | ;; account for comparision. |
| @@ -152,8 +155,8 @@ association to the service from D-Bus." | |||
| 152 | ;; Loop over the registered functions. | 155 | ;; Loop over the registered functions. |
| 153 | (dolist (elt entry) | 156 | (dolist (elt entry) |
| 154 | (when (equal | 157 | (when (equal |
| 155 | (car value) | 158 | value |
| 156 | (butlast (cdr elt) (- (length (cdr elt)) (length (car value))))) | 159 | (butlast (cdr elt) (- (length (cdr elt)) (length value)))) |
| 157 | (setq ret t) | 160 | (setq ret t) |
| 158 | ;; Compute new hash value. If it is empty, remove it from the | 161 | ;; Compute new hash value. If it is empty, remove it from the |
| 159 | ;; hash table. | 162 | ;; hash table. |
| @@ -162,17 +165,16 @@ association to the service from D-Bus." | |||
| 162 | ;; Remove match rule of signals. | 165 | ;; Remove match rule of signals. |
| 163 | (let ((rule (nth 4 elt))) | 166 | (let ((rule (nth 4 elt))) |
| 164 | (when (stringp rule) | 167 | (when (stringp rule) |
| 168 | (setq service nil) ; We do not need to unregister the service. | ||
| 165 | (dbus-call-method | 169 | (dbus-call-method |
| 166 | (car key) dbus-service-dbus dbus-path-dbus dbus-interface-dbus | 170 | bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus |
| 167 | "RemoveMatch" rule))))) | 171 | "RemoveMatch" rule))))) |
| 168 | ;; Check, whether there is still a registered function or property | 172 | ;; Check, whether there is still a registered function or property |
| 169 | ;; for the given service. If not, unregister the service from the | 173 | ;; for the given service. If not, unregister the service from the |
| 170 | ;; bus. | 174 | ;; bus. |
| 171 | (dolist (elt entry) | 175 | (when service |
| 172 | (let ((service (cadr elt)) | 176 | (dolist (elt entry) |
| 173 | (bus (car key)) | 177 | (let (found) |
| 174 | found) | ||
| 175 | (when service | ||
| 176 | (maphash | 178 | (maphash |
| 177 | (lambda (k v) | 179 | (lambda (k v) |
| 178 | (dolist (e v) | 180 | (dolist (e v) |