summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-26 15:25:58 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-26 15:25:58 +0000
commit8f2e14aa3ab73a2e53809730ac7878aca48d8d82 (patch)
tree4311866b9628213e17910311205120fdeb06b5fd
parentb9a216a6ef0510cd2a5b2675ec566bf55eff35b1 (diff)
bug fix on Win : hang-up when calling 'exit' in the Tk callback
procedure. [ruby-list:38656] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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;
}