emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105899: * net/dbus.el (dbus-unregist


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105899: * net/dbus.el (dbus-unregister-object): Remove match rule of signals.
Date: Sat, 24 Sep 2011 13:45:13 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105899
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sat 2011-09-24 13:45:13 +0200
message:
  * net/dbus.el (dbus-unregister-object): Remove match rule of signals.
  Release services only if they are defined.  (Bug#9581)
modified:
  lisp/ChangeLog
  lisp/net/dbus.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-23 23:55:52 +0000
+++ b/lisp/ChangeLog    2011-09-24 11:45:13 +0000
@@ -1,3 +1,8 @@
+2011-09-24  Michael Albinus  <address@hidden>
+
+       * net/dbus.el (dbus-unregister-object): Remove match rule of signals.
+       Release services only if they are defined.  (Bug#9581)
+
 2011-09-23  Richard Stallman  <address@hidden>
 
        * textmodes/paragraphs.el (forward-sentence): For backwards case,

=== modified file 'lisp/net/dbus.el'
--- a/lisp/net/dbus.el  2011-05-23 17:57:17 +0000
+++ b/lisp/net/dbus.el  2011-09-24 11:45:13 +0000
@@ -143,7 +143,7 @@
         (value (cdr object))
         (entry (gethash key dbus-registered-objects-table))
         ret)
-    ;; entry has the structure ((UNAME SERVICE PATH MEMBER) ...).
+    ;; 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
@@ -154,11 +154,17 @@
       (when (equal
             (car value)
             (butlast (cdr elt) (- (length (cdr elt)) (length (car value)))))
+       (setq ret t)
        ;; Compute new hash value.  If it is empty, remove it from the
        ;; hash table.
        (unless (puthash key (delete elt entry) dbus-registered-objects-table)
          (remhash key dbus-registered-objects-table))
-       (setq ret t)))
+       ;; Remove match rule of signals.
+       (let ((rule (nth 4 elt)))
+         (when (stringp rule)
+           (dbus-call-method
+            (car key) 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.
@@ -166,17 +172,18 @@
       (let ((service (cadr elt))
            (bus (car key))
            found)
-       (maphash
-        (lambda (k v)
-          (dolist (e v)
-            (ignore-errors
-              (when (and (equal bus (car k)) (string-equal service (cadr e)))
-                (setq found t)))))
-        dbus-registered-objects-table)
-       (unless found
-         (dbus-call-method
-          bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus
-          "ReleaseName" service))))
+       (when service
+         (maphash
+          (lambda (k v)
+            (dolist (e v)
+              (ignore-errors
+                (when (and (equal bus (car k)) (string-equal service (cadr e)))
+                  (setq found t)))))
+          dbus-registered-objects-table)
+         (unless found
+           (dbus-call-method
+            bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus
+            "ReleaseName" service)))))
     ;; Return.
     ret))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]