[slime-devel] Shutting down Swank within an Image.

Nikodemus Siivola nikodemus at random-state.net
Fri Nov 4 16:03:28 UTC 2011


On 4 November 2011 17:54, Andrew Myers <asm198 at gmail.com> wrote:
> I've got an updated version that seems to work quite well:
>
> (defun aux-save-image (image-name)
>  (let ((old-restart excl:*restart-init-function*))
>    (setf excl:*restart-init-function*
>          (lambda ()
>            (dolist (connection swank::*connections*)
>              (format t "closing ~a~%" connection)
>              (swank::close-connection connection nil nil))
>            (when old-restart
>              (funcall old-restart))))
>    (excl:dumplisp :name image-name)
>    (setf excl:*restart-init-function* old-restart)))
>
> Is there anything wrong with doing things this way?  I get the same

Closing a connection on initialization is risky. Consider: what if the
underlying FD has is already in use in the new image?

You should clean up before you save, not when you initialize.

Cheers,

 -- Nikodemus




More information about the slime-devel mailing list