diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-11 17:29:51 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-11 17:29:51 +0000 |
commit | 7f2298504819c17bdb7bbb29db274203ed84d505 (patch) | |
tree | 6f1aa81e0b23d18731e5f938d2853b665ff51029 | |
parent | d822ffdc04e125d19daeeef71bc100377cf54e0b (diff) | |
download | ruby-7f2298504819c17bdb7bbb29db274203ed84d505.tar.gz |
* ext/tk/tcltklib.c (ip_finalize): add existence check of Tcl commands
before calling Tcl_GlobalEval().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/tk/tcltklib.c | 19 |
2 files changed, 21 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Tue Apr 12 02:21:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> + + * ext/tk/tcltklib.c (ip_finalize): add existence check of + Tcl commands before calling Tcl_GlobalEval(). + Mon Apr 11 23:36:04 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/tk/tcltklib.c b/ext/tk/tcltklib.c index 21c9d904cc..f744df9409 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -4407,16 +4407,29 @@ ip_finalize(ip) delete_slaves(ip); /* delete root widget */ - Tcl_GlobalEval(ip, "catch {destroy .}"); + DUMP1("check `destroy'"); + if ( Tcl_GetCommandInfo(ip, "catch", &info) + && Tcl_GetCommandInfo(ip, "destroy", &info) ) { + DUMP1("call `destroy'"); + Tcl_GlobalEval(ip, "catch {destroy .}"); + } /* call finalize-hook-proc */ + DUMP1("check `finalize-hook-proc'"); if (Tcl_GetCommandInfo(ip, finalize_hook_name, &info)) { DUMP2("call finalize hook proc '%s'", finalize_hook_name); Tcl_GlobalEval(ip, finalize_hook_name); } - DUMP1("cancel after scripts"); - Tcl_GlobalEval(ip, "catch {foreach id [after info] {after cancel $id}}"); + DUMP1("cancel after callbacks"); + 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); |