summaryrefslogtreecommitdiff
path: root/ext/tcltklib
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
commit24807afceaddb4b8cb8f3b9e46de98cf85c8c9a0 (patch)
tree853dce40aeb97e51b42549fdb2b1d6d64155f37f /ext/tcltklib
parent3fe82505450e5fd1f7de4fbfc428e47fd0cf5969 (diff)
* ext/tcltklib/tcltklib.c (ip_finalize): add existence check of
Tcl commands before calling Tcl_GlobalEval(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tcltklib')
-rw-r--r--ext/tcltklib/tcltklib.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 21c9d904cc..407894c2d2 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);