* ext/tk/tcltklib.c: fix SEGV when embedding to an application.

[ruby-core:7600]
* ext/tk/tcltklib.c: fix SEGV at exit. [ruby-talk:186489]
* ext/tk/tkutil/tkutil.c: follow to changing specification of
  instance_eval on ruby-1.9.x.
* ext/tk/lib/tk.rb: ditto.
* ext/tk/lib/multi-tk.rb: ditto.
* ext/tk/lib/tk.rb: remove warning about redefinition of methods.
* ext/tk/lib/tk/variable.rb: remove warning about unseting Tcl
 variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2006-04-05 16:08:45 +00:00
parent 4cef04b494
commit 52d25a671b
6 changed files with 87 additions and 39 deletions

View file

@ -8,10 +8,11 @@
************************************************/
#define TKUTIL_RELEASE_DATE "2005-11-07"
#define TKUTIL_RELEASE_DATE "2006-04-06"
#include "ruby.h"
#include "rubysig.h"
#include "version.h"
#include "st.h"
static VALUE cMethod;
@ -57,7 +58,13 @@ tk_s_new(argc, argv, klass)
{
VALUE obj = rb_class_new_instance(argc, argv, klass);
if (rb_block_given_p()) rb_obj_instance_eval(0, 0, obj);
if (rb_block_given_p()) {
#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR <= 8 /* ruby 1.8.x */
rb_obj_instance_eval(0, 0, obj);
#else
rb_obj_instance_exec(1, &obj, obj);
#endif
}
return obj;
}