branch: externals/bluetooth
commit a883d60487d7a59254dfd37ac355e9baf23f6691
Author: Raffael Stocker <r.stoc...@mnet-mail.de>
Commit: Raffael Stocker <r.stoc...@mnet-mail.de>

    fixes spurious error on clean-up
    
    This is a work-around using `ignore-errors' around the dbus unregistering
    functions.
---
 bluetooth.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/bluetooth.el b/bluetooth.el
index 217c7e5..ccbcee1 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -349,9 +349,7 @@ This function only uses the first adapter reported by 
Bluez."
       (concat "[" info "] "))))
 
 (defun bluetooth--cleanup ()
-  "Clean up."
-  (setq mode-line-misc-info (cl-remove bluetooth--mode-info
-                                      mode-line-misc-info))
+  "Clean up when mode buffer is killed."
   (bluetooth--unregister-agent))
 
 ;;; This command is the main entry point.  It is meant to be called by
@@ -497,10 +495,11 @@ This function only uses the first adapter reported by 
Bluez."
 
 (defun bluetooth--unregister-agent ()
   "Unregister the pairing agent."
-  (mapc #'dbus-unregister-object bluetooth--method-objects)
-  (dbus-call-method :system bluetooth--service bluetooth--root
-                   bluetooth--agent-mngr-intf "UnregisterAgent"
-                   :object-path bluetooth--own-path))
+  (ignore-errors
+    (dbus-call-method :system bluetooth--service bluetooth--root
+                     bluetooth--agent-mngr-intf "UnregisterAgent"
+                     :object-path bluetooth--own-path)
+    (mapc #'dbus-unregister-object bluetooth--method-objects)))
 
 (provide 'bluetooth)
 

Reply via email to