added a guard against recursive calls to exit

original commit: 04791041223649bcbbd1acadd82df376341fa745
This commit is contained in:
Robby Findler 1996-11-12 17:02:29 +00:00
parent bd2b320134
commit c03c506456

View File

@ -33,23 +33,28 @@
[else (loop (cdr cb-list))])))))
(define -exit
(lambda ()
(let/ec k
(when (and (mred:preferences:get-preference 'mred:verify-exit)
(not (let ([w (if (eq? wx:platform 'macintosh)
"quit"
"exit")]
[capW (if (eq? wx:platform 'macintosh)
"Quit"
"Exit")])
(mred:gui-utils:get-choice
(string-append "Are you sure you want to " w "?")
capW "Cancel"))))
(k #f))
(run-exit-callbacks)
(if (null? exit-callbacks)
(begin (when mred:debug:exit?
(exit))
#t)
#f))))))
(let ([exiting? #f])
(lambda ()
(unless exiting?
(dynamic-wind
(lambda () (set! exiting? #t))
(lambda ()
(let/ec k
(when (and (mred:preferences:get-preference 'mred:verify-exit)
(not (let ([w (if (eq? wx:platform 'macintosh)
"quit"
"exit")]
[capW (if (eq? wx:platform 'macintosh)
"Quit"
"Exit")])
(mred:gui-utils:get-choice
(string-append "Are you sure you want to " w "?")
capW "Cancel"))))
(k #f))
(run-exit-callbacks)
(if (null? exit-callbacks)
(exit)
#f)))
(lambda () (set! exiting? #f)))))))))