emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive 015917ecd3 14/19: Fix: (h//download-monitor) Ca


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 015917ecd3 14/19: Fix: (h//download-monitor) Cancel timer if buffer killed
Date: Thu, 1 Aug 2024 01:00:11 -0400 (EDT)

branch: elpa/hyperdrive
commit 015917ecd326f1d7a7fca57ecd601253e61b0368
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Fix: (h//download-monitor) Cancel timer if buffer killed
---
 hyperdrive-download-monitor.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hyperdrive-download-monitor.el b/hyperdrive-download-monitor.el
index ee9a723f57..73d5f3acf9 100644
--- a/hyperdrive-download-monitor.el
+++ b/hyperdrive-download-monitor.el
@@ -50,7 +50,11 @@ UPDATE-INTERVAL seconds."
             (map-elt h/download-monitor-etc :preamble) preamble
             (map-elt h/download-monitor-etc :started-at) (current-time)
             (map-elt h/download-monitor-etc :timer)
-            (run-at-time nil update-interval #'h//download-monitor-update 
buffer)))
+            (run-at-time nil update-interval #'h//download-monitor-update 
buffer))
+      (setq-local kill-buffer-hook
+                  (cons (lambda ()
+                          (cancel-timer (map-elt h/download-monitor-etc 
:timer)))
+                        kill-buffer-hook)))
     buffer))
 
 (defun h//download-monitor-update (buffer)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]