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

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

[nongnu] elpa/hyperdrive 9156b1a7ac 16/19: Fix: Ensure timer before canc


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 9156b1a7ac 16/19: Fix: Ensure timer before canceling
Date: Thu, 1 Aug 2024 01:00:12 -0400 (EDT)

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

    Fix: Ensure timer before canceling
---
 hyperdrive-download-monitor.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hyperdrive-download-monitor.el b/hyperdrive-download-monitor.el
index 75b245bddd..ff66fc53bc 100644
--- a/hyperdrive-download-monitor.el
+++ b/hyperdrive-download-monitor.el
@@ -53,7 +53,8 @@ UPDATE-INTERVAL seconds."
             (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)))
+                          (when (timerp (map-elt h/download-monitor-etc 
:timer))
+                            (cancel-timer (map-elt h/download-monitor-etc 
:timer))))
                         kill-buffer-hook)))
     buffer))
 
@@ -81,7 +82,8 @@ UPDATE-INTERVAL seconds."
 (defun h//download-monitor-close (buffer)
   "Close download monitor BUFFER."
   (with-current-buffer buffer
-    (cancel-timer (map-elt h/download-monitor-etc :timer)))
+    (when (timerp (map-elt h/download-monitor-etc :timer))
+      (cancel-timer (map-elt h/download-monitor-etc :timer))))
   (let ((buffer-window (get-buffer-window buffer)))
     (when buffer-window
       (quit-window nil buffer-window)))



reply via email to

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