summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-11 17:29:15 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-11 17:29:15 +0000
commitc3183591b87a008aa412ad97b93ace43f40b494c (patch)
tree853dce40aeb97e51b42549fdb2b1d6d64155f37f
parentdac2a348597f309e6a28dd631c71b613e1caefc4 (diff)
downloadruby-c3183591b87a008aa412ad97b93ace43f40b494c.tar.gz
ruby-c3183591b87a008aa412ad97b93ace43f40b494c.tar.xz
ruby-c3183591b87a008aa412ad97b93ace43f40b494c.zip
* ext/tcltklib/tcltklib.c (ip_finalize): add existence check of
Tcl commands before calling Tcl_GlobalEval(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/tcltklib/tcltklib.c15
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index eeb0a62db..4b705b06b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 12 02:21:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tcltklib/tcltklib.c (ip_finalize): add existence check of
+ Tcl commands before calling Tcl_GlobalEval().
+
Mon Apr 11 23:47:21 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/drb/drb.r: [druby-ja:123] fix: When reference of my object is
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 21c9d904c..407894c2d 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -4407,7 +4407,11 @@ ip_finalize(ip)
delete_slaves(ip);
/* delete root widget */
- Tcl_GlobalEval(ip, "catch {destroy .}");
+ if ( Tcl_GetCommandInfo(ip, "catch", &info)
+ && Tcl_GetCommandInfo(ip, "destroy", &info) ) {
+ DUMP1("call `destroy'");
+ Tcl_GlobalEval(ip, "catch {destroy .}");
+ }
/* call finalize-hook-proc */
if (Tcl_GetCommandInfo(ip, finalize_hook_name, &info)) {
@@ -4416,7 +4420,14 @@ ip_finalize(ip)
}
DUMP1("cancel after scripts");
- Tcl_GlobalEval(ip, "catch {foreach id [after info] {after cancel $id}}");
+ DUMP1("check `foreach' & `after'");
+ if ( Tcl_GetCommandInfo(ip, "catch", &info)
+ && Tcl_GetCommandInfo(ip, "foreach", &info)
+ && Tcl_GetCommandInfo(ip, "after", &info) ) {
+ DUMP1("call `foreach' & `after'");
+ Tcl_GlobalEval(ip,
+ "catch {foreach id [after info] {after cancel $id}}");
+ }
Tcl_Release(ip);