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 | 8ba823c485d481979600000a111b3b108f98ad6f (patch) | |
tree | 0f16c5ad4af73651c0069b514d1e8128bbff3c80 /ext/tk/lib | |
parent | 5ebb8ad06bb936c048f890fbfd1495134a825912 (diff) | |
download | ruby-8ba823c485d481979600000a111b3b108f98ad6f.tar.gz |
* 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/trunk@10078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib')
-rw-r--r-- | ext/tk/lib/multi-tk.rb | 2 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 20 | ||||
-rw-r--r-- | ext/tk/lib/tk/variable.rb | 12 |
3 files changed, 18 insertions, 16 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index 6581ff8da7..84c2322d56 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -142,7 +142,7 @@ class MultiTkIp ###################################### - @@CB_ENTRY_CLASS = Class.new(TkCallbackEntry){|c| + @@CB_ENTRY_CLASS = Class.new(TkCallbackEntry){ def initialize(ip, cmd) @ip = ip @cmd = cmd diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 55408dda2f..bf053058da 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1121,8 +1121,8 @@ module TkCore @init_ip_env = [].taint # table of Procs @add_tk_procs = [].taint # table of [name, args, body] - @cb_entry_class = Class.new(TkCallbackEntry){|c| - class << c + @cb_entry_class = Class.new(TkCallbackEntry){ + class << self def inspect sprintf("#<Class(TkCallbackEntry):%0x>", self.__id__) end @@ -2310,11 +2310,15 @@ if (/^(8\.[1-9]|9\.|[1-9][0-9])/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK) end module TclTkLib - def self.encoding=(name) - TkCore::INTERP.encoding = name - end - def self.encoding - TkCore::INTERP.encoding + class << self + alias _encoding encoding + alias _encoding= encoding= + def encoding=(name) + TkCore::INTERP.encoding = name + end + def encoding + TkCore::INTERP.encoding + end end end @@ -4555,7 +4559,7 @@ end #Tk.freeze module Tk - RELEASE_DATE = '2005-12-07'.freeze + RELEASE_DATE = '2006-04-06'.freeze autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' diff --git a/ext/tk/lib/tk/variable.rb b/ext/tk/lib/tk/variable.rb index 1ea41b729b..e5cacadc1a 100644 --- a/ext/tk/lib/tk/variable.rb +++ b/ext/tk/lib/tk/variable.rb @@ -266,8 +266,11 @@ TkCore::INTERP.add_tk_procs('rb_var', 'args', <<-'EOL') def initialize(val="", type=nil) # @id = Tk_VARIABLE_ID.join('') - @id = Tk_VARIABLE_ID.join(TkCore::INTERP._ip_id_) - Tk_VARIABLE_ID[1].succ! + begin + @id = Tk_VARIABLE_ID.join(TkCore::INTERP._ip_id_) + Tk_VARIABLE_ID[1].succ! + end until INTERP._invoke_without_enc('info', 'globals', @id).empty? + TkVar_ID_TBL[@id] = self @var = @id @@ -286,11 +289,6 @@ TkCore::INTERP.add_tk_procs('rb_var', 'args', <<-'EOL') self.default_value_type = type - begin - INTERP._unset_global_var(@id) - rescue - end - # teach Tk-ip that @id is global var INTERP._invoke_without_enc('global', @id) #INTERP._invoke('global', @id) |