From e3344184b11fa45e30ff18d853c06cc826e5fd2d Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 21 Jul 2005 22:05:04 +0000 Subject: * ext/tk/tkutil/tkutil.c (tk_conv_args): forget to revert thread_critical and gc_disable when raise ArgumentError. * ext/tk/lib/remote-tk.rb: RemoteTkIp doesn't need to include TkUtil. * ext/tk/tcltklib.c: add TclTkIp#has_mainwindow? method. * ext/tk/lib/tk.rb: add Tk.has_mainwindow? method. * ext/tk/lib/multi-tk.rb: add MultiTkIp#has_mainwindow? method. * ext/tk/lib/remote-tk.rb: add RemoteTkIp#has_mainwindow? method. * ext/tk/lib/multi-tk.rb: slave IP fail to exit itself when $SAFE==4. * ext/tk/lib/multi-tk.rb: remove constants from MultiTkIp module to avoid access from external. * ext/tk/lib/multi-tk.rb: check_root flag is ignored on slave IPs' mainloop. * ext/tk/lib/multi-tk.rb: hang-up Tk.mainloop called on a slave IP with $SAFE==4. * ext/tk/lib/multi-tk.rb: MultiTkIp#bg_eval_proc doesn't work properly. * ext/tk/lib/multi-tk.rb: add MultiTkIp#set_cb_error(proc) and cb_error(exc) to log errors at callbacks on safe slave IPs. * ext/tk/lib/multi-tk.rb: fail to get an available slave IP object when call Tk.mainloop in the block which is given to new_* method, because cannot finish initialize while the root widget is alive. * ext/tk/lib/multi-tk.rb: fail to control a slave IP when Tk.mainloop runs on the IP. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/tkutil/tkutil.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ext/tk/tkutil/tkutil.c') diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c index 464bbafa9..496649f8c 100644 --- a/ext/tk/tkutil/tkutil.c +++ b/ext/tk/tkutil/tkutil.c @@ -8,7 +8,7 @@ ************************************************/ -#define TKUTIL_RELEASE_DATE "2005-07-05" +#define TKUTIL_RELEASE_DATE "2005-07-22" #include "ruby.h" #include "rubysig.h" @@ -892,14 +892,14 @@ tk_conv_args(argc, argv, self) int thr_crit_bup; VALUE old_gc; + if (argc < 2) { + rb_raise(rb_eArgError, "too few arguments"); + } + thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; - old_gc = rb_gc_disable(); - if (argc < 2) { - rb_raise(rb_eArgError, "too few arguments"); - } for(size = 0, idx = 2; idx < argc; idx++) { if (TYPE(argv[idx]) == T_HASH) { size += 2 * RHASH(argv[idx])->tbl->num_entries; @@ -1605,6 +1605,7 @@ Init_tkutil() tk_get_eval_string, -1); rb_define_singleton_method(mTK, "_get_eval_enc_str", tk_get_eval_enc_str, 1); + rb_define_singleton_method(mTK, "_conv_args", tk_conv_args, -1); rb_define_singleton_method(mTK, "bool", tcl2rb_bool, 1); rb_define_singleton_method(mTK, "number", tcl2rb_number, 1); -- cgit