summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp-cache.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index ac5a9c45bbd..7227c9bf7cc 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -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))