1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Make tramp unloading handle debug counter variables

* lisp/net/tramp-cache.el (tramp-get-file-property)
(tramp-set-file-property): Add counter variables to tramp-unload-hook.
This commit is contained in:
Glenn Morris 2017-07-20 13:46:52 -04:00
parent 9c6cacd338
commit ee5ec64624

View file

@ -136,7 +136,11 @@ Returns DEFAULT if not set."
(tramp-message key 8 "%s %s %s" file property value)
(when (>= tramp-verbose 10)
(let* ((var (intern (concat "tramp-cache-get-count-" property)))
(val (or (and (boundp var) (symbol-value var)) 0)))
(val (or (and (boundp var) (symbol-value var))
(progn
(add-hook 'tramp-unload-hook
(lambda () (makunbound var)))
0))))
(set var (1+ val))))
value))
@ -156,7 +160,11 @@ Returns VALUE."
(tramp-message key 8 "%s %s %s" file property value)
(when (>= tramp-verbose 10)
(let* ((var (intern (concat "tramp-cache-set-count-" property)))
(val (or (and (boundp var) (symbol-value var)) 0)))
(val (or (and (boundp var) (symbol-value var))
(progn
(add-hook 'tramp-unload-hook
(lambda () (makunbound var)))
0))))
(set var (1+ val))))
value))