Skip to content

Commit a54f613

Browse files
rfkmcap10morgan
authored andcommitted
[Fix #1482] Clear nREPL sessions when connection is closed
1 parent 693d225 commit a54f613

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* [#1452](https://github.com/clojure-emacs/cider/issues/1452): Prevent ANSI color overlays in the REPL buffer from being extended.
1616
* [#1486](https://github.com/clojure-emacs/cider/issues/1486): Complete a partial fix in stacktrace font-locking.
1717
* [#1488](https://github.com/clojure-emacs/cider/pull/1488): Delete zombie overlays in the REPL buffer.
18+
* [#1482](https://github.com/clojure-emacs/cider/issues/1482): Clear nREPL sessions when a connection is closed.
1819

1920
## 0.10.0 / 2015-12-03
2021

nrepl-client.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ and kill the process buffer."
615615
(substring message 0 -1)))
616616
(when (equal (process-status process) 'closed)
617617
(when-let ((client-buffer (process-buffer process)))
618+
(nrepl--clear-client-sessions client-buffer)
618619
(with-current-buffer client-buffer
619620
(run-hooks 'nrepl-disconnected-hook)
620621
(when (buffer-live-p nrepl-server-buffer)
@@ -800,6 +801,12 @@ values of *1, *2, etc."
800801
(setq nrepl-ops ops)
801802
(setq nrepl-versions versions)))))
802803

804+
(defun nrepl--clear-client-sessions (conn-buffer)
805+
"Clear client nREPL sessions in CONN-BUFFER."
806+
(with-current-buffer conn-buffer
807+
(setq nrepl-session nil)
808+
(setq nrepl-tooling-session nil)))
809+
803810
(define-obsolete-function-alias 'nrepl-close 'cider--close-connection-buffer "0.10.0")
804811

805812
;;; Client: Response Handling

0 commit comments

Comments
 (0)