From ee5ec64624b72fb5c18945949437c6371c76d14c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 20 Jul 2017 13:46:52 -0400 Subject: [PATCH] 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. --- lisp/net/tramp-cache.el | 12 ++++++++++-- 1 file 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)) -- 2.39.2