diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | ext/tcltklib/tcltklib.c | 15 |
2 files changed, 18 insertions, 2 deletions
@@ -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); |
