From d622a02098ca0094e594065ab3acbf39f937c989 Mon Sep 17 00:00:00 2001 From: cage Date: Mon, 4 Oct 2021 20:42:39 +0200 Subject: [PATCH] - [gemini] prevented signalling a condition when quitting the program and a gemini text is streaming; if there is some gemini text streaming the function 'ui:clean-temporary-file' will remove the file that the streaming thread is using for caching. So when the gemini rendering thread returns will try to remove the already deleted file, leading to a crash. --- src/gemini-viewer.lisp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gemini-viewer.lisp b/src/gemini-viewer.lisp index c34ac66..b361be6 100644 --- a/src/gemini-viewer.lisp +++ b/src/gemini-viewer.lisp @@ -281,13 +281,17 @@ (defmacro with-open-support-file ((stream file &optional (element-type '(unsigned-byte 8))) &body body) - `(with-open-file (,stream ,file - :element-type ',element-type - :direction :output - :element-type 'character - :if-exists :supersede - :if-does-not-exist :create) - ,@body)) + `(handler-case + (with-open-file (,stream ,file + :element-type ',element-type + :direction :output + :element-type 'character + :if-exists :supersede + :if-does-not-exist :create) + ,@body) + (file-error (condition) + (declare (ignore condition)) + nil))) (defgeneric increment-bytes-count (object data &key &allow-other-keys))