summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/tcltklib/tcltklib.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ee8d2650dd..db8dc05d9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Oct 27 00:23:50 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tcltklib/tcltklib.c (ip_ruby): bug fix on Win : hang-up when
+ calling 'exit' in the Tk callback procedure. [ruby-list:38656]
+
Sat Oct 25 09:18:04 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_method_missing): protect exception from within
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 6902f1e15c..ef93a4930f 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -820,7 +820,8 @@ ip_ruby(clientData, interp, argc, argv)
rb_trap_immediate = 0;
res = rb_rescue2(rb_eval_string, (VALUE)arg,
ip_eval_rescue, (VALUE)&failed,
- rb_eStandardError, rb_eScriptError, (VALUE)0);
+ rb_eStandardError, rb_eScriptError, rb_eSystemExit,
+ (VALUE)0);
rb_trap_immediate = old_trapflg;
/* status check */
@@ -833,6 +834,9 @@ ip_ruby(clientData, interp, argc, argv)
return TCL_BREAK;
} else if (eclass == eTkCallbackContinue) {
return TCL_CONTINUE;
+ } else if (eclass == rb_eSystemExit) {
+ Tcl_Eval(interp, "destroy .");
+ rb_raise(rb_eSystemExit, StringValuePtr(failed));
} else {
return TCL_ERROR;
}