5 (defun stop-main-thread-on-save ()
6 (when (and *main-thread* (bt:thread-alive-p *main-thread*))
7 (within-main-loop-and-wait (gtk-main-quit))
8 (bt:destroy-thread *main-thread*)
9 (setf *main-thread* nil)))
10 (defun cl-gtk2-sbcl-init ()
12 (pushnew 'cl-gtk2-sbcl-init sb-ext:*init-hooks*)
13 (pushnew 'stop-main-thread-on-save sb-ext:*save-hooks*))