diff options
| author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-04-05 16:08:45 +0000 |
|---|---|---|
| committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-04-05 16:08:45 +0000 |
| commit | 24758ea6c24128d3da279ef52372fcd6884352ff (patch) | |
| tree | 0f16c5ad4af73651c0069b514d1e8128bbff3c80 /ext/tk/tkutil | |
| parent | f1675c48adfe28480acb53de9b344d15c1c73c1d (diff) | |
| download | ruby-24758ea6c24128d3da279ef52372fcd6884352ff.tar.gz ruby-24758ea6c24128d3da279ef52372fcd6884352ff.tar.xz ruby-24758ea6c24128d3da279ef52372fcd6884352ff.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@10078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/tkutil')
| -rw-r--r-- | ext/tk/tkutil/tkutil.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c index 620ac36c1..f4271a724 100644 --- a/ext/tk/tkutil/tkutil.c +++ b/ext/tk/tkutil/tkutil.c @@ -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; } |
