From 39f6a4bc3ac3f1664a9d5f2662673681e93527f8 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Mon, 13 Aug 2007 14:11:53 +0000 Subject: [PATCH] stop is idempotent now svn: r7085 --- collects/htdch/draw/support.scm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/collects/htdch/draw/support.scm b/collects/htdch/draw/support.scm index 4d6bf78337..2a3070159b 100644 --- a/collects/htdch/draw/support.scm +++ b/collects/htdch/draw/support.scm @@ -201,10 +201,13 @@ void-or-true) (define (endOfTime-java.lang.String-native this accs gets privates s) - (define theCanvas ((hash-table-get accs 'theCanvas) this)) - (define _ (check-string s "endOfTime(String)" "first")) - (message-box "end of time" (send s get-mzscheme-string)) - (send theCanvas stop) + (define _ (check-string s "endOfTime(String)" "first")) + (define t (send s get-mzscheme-string)) + (define theCanvas ((hash-table-get accs 'theCanvas) this)) + (parameterize ([current-eventspace (make-eventspace)]) + (message-box "end of world" (send s get-mzscheme-string))) + (unless (null? theCanvas) + (send theCanvas stop)) #t) (define (endOfWorld-java.lang.String-native this accs gets privates s) @@ -212,6 +215,7 @@ (define _ (check-string s "endOfWorld(String)" "first")) (parameterize ([current-eventspace (make-eventspace)]) (message-box "end of world" (send s get-mzscheme-string))) - (send theCanvas stop) + (unless (null? theCanvas) + (send theCanvas stop)) this)) )