Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
8fb1629f
Commit
8fb1629f
authored
Nov 09, 2009
by
Michael Albinus
Browse files
* net/dbus.el (dbus-unregister-object): Release service, if no
other method is registered for it.
parent
362654a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
8 deletions
+32
-8
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/net/dbus.el
lisp/net/dbus.el
+27
-8
No files found.
lisp/ChangeLog
View file @
8fb1629f
2009-11-09 Michael Albinus <michael.albinus@gmx.de>
* net/dbus.el (dbus-unregister-object): Release service, if no
other method is registered for it.
2009-11-08 Markus Rost <rost@math.uni-bielefeld.de>
* bookmark.el (bookmark-completing-read): Sort bookmark names if
...
...
lisp/net/dbus.el
View file @
8fb1629f
...
...
@@ -139,23 +139,42 @@ been unregistered, `nil' otherwise."
;; Find the corresponding entry in the hash table.
(
let*
((
key
(
car
object
))
(
value
(
gethash
key
dbus-registered-functions-table
)))
(
value
(
gethash
key
dbus-registered-functions-table
))
(
bus
(
car
key
))
ret
)
;; Loop over the registered functions.
(
while
(
consp
value
)
;;
(car value)
has the structure (UNAME SERVICE PATH HANDLER).
(
dolist
(
val
value
)
;;
val
has the structure (UNAME SERVICE PATH HANDLER).
;; (cdr object) has the structure ((SERVICE PATH HANDLER) ...).
(
if
(
not
(
equal
(
cdr
(
car
value
))
(
car
(
cdr
object
))))
(
setq
value
(
cdr
value
))
(
when
(
equal
(
cdr
val
)
(
car
(
cdr
object
)))
;; Compute new hash value. If it is empty, remove it from
;; hash table.
(
unless
(
puthash
key
(
delete
(
car
value
)
(
gethash
key
dbus-registered-functions-table
))
(
delete
val
(
gethash
key
dbus-registered-functions-table
))
dbus-registered-functions-table
)
(
remhash
key
dbus-registered-functions-table
))
(
setq
value
t
)))
value
))
(
setq
ret
t
)))
;; Check, whether there is still a registered function for the
;; given service. If not, unregister the service from the bus.
(
dolist
(
val
value
)
(
let
((
service
(
cadr
val
))
found
)
(
maphash
(
lambda
(
k
v
)
(
dolist
(
val
v
)
(
ignore-errors
(
when
(
and
(
equal
bus
(
car
k
))
(
string-equal
service
(
cadr
val
))))
(
setq
found
t
))))
dbus-registered-functions-table
)
(
unless
found
(
dbus-call-method
bus
dbus-service-dbus
dbus-path-dbus
dbus-interface-dbus
"ReleaseName"
service
))))
;; Return.
ret
))
(
defun
dbus-call-method-non-blocking-handler
(
&rest
args
)
"Handler for reply messages of asynchronous D-Bus message calls.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment