branch: externals/sly commit 748fd921ef220d25072ca646d4b125c4806c8025 Author: Luís Borges de Oliveira <l...@siscog.pt> Commit: João Távora <joaotav...@gmail.com>
Do close streams in CLOSE-LISTENER when closing SLYNK::LISTENER Also, ignore errors when doing this in SLYNK::CLOSE-CONNECTION%. This was inspired by SLIME commit 1761172817d2e1a8b48c216bf0d261eb277ae562, which came with the following comment. E.g., in Allegro CL, if we EXCL:DUMPLISP with SLIME running (with SWANK:*GLOBALLY-REDIRECT-IO* enabled), we can clean things up with SWANK:CLOSE-CONNECTION when starting from the dumped image, except an error occurs when closing this stream since it will point to a stale socket. --- slynk/slynk.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slynk/slynk.lisp b/slynk/slynk.lisp index 6217ab5..3515b23 100644 --- a/slynk/slynk.lisp +++ b/slynk/slynk.lisp @@ -606,8 +606,7 @@ corresponding values in the CDR of VALUE." (clear-input in))) (defmethod close-listener (l) - ;; TODO: investigate why SBCL complains when we close IN and OUT - ;; here. + (with-slots (in out) l (close in) (close out)) (setf (listeners) (delete l (listeners)))) @@ -1174,7 +1173,8 @@ point the thread terminates and CHANNEL is closed." (format *log-output* "~&;; closing ~a channels~%" (length (connection-channels c))) (mapc #'(lambda (c) (close-channel c :force t)) (connection-channels c)) (format *log-output* "~&;; closing ~a listeners~%" (length (connection-listeners c))) - (mapc #'close-listener (connection-listeners c))) + (ignore-errors + (mapc #'close-listener (connection-listeners c)))) (stop-serving-requests c) (close (connection-socket-io c)) (setf *connections* (remove c *connections*))