Skip to content

Commit

Permalink
Merge pull request flycheck#1796 from flycheck/cpitclaudel_fix-delete…
Browse files Browse the repository at this point in the history
…d-buffer

Check whether buffers are live before invoking flycheck-teardown in them
  • Loading branch information
cpitclaudel authored Dec 23, 2020
2 parents 7ffbbfc + 906ebde commit 0dd1430
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -3584,9 +3584,10 @@ Also remove global hooks. (If optional argument IGNORE-LOCAL is
non-nil, then only do this and skip per-buffer teardown.)"
(unless ignore-local
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when flycheck-mode
(flycheck-teardown 'ignore-global)))))
(when (buffer-live-p buffer)
(with-current-buffer buffer
(when flycheck-mode
(flycheck-teardown 'ignore-global))))))
(remove-hook 'buffer-list-update-hook #'flycheck-handle-buffer-switch))

;; Clean up the entire state of Flycheck when Emacs is killed, to get rid of any
Expand Down

0 comments on commit 0dd1430

Please sign in to comment.