diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-15 16:24:31 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-15 16:24:31 +0000 |
commit | f78fcf1010ce62cd4c52d124bd283fa398f5a9f1 (patch) | |
tree | 2290d40b550238f65113d8f9fe7262c3dab3f481 | |
parent | 5bca86dde251a9c03330737546256a9efcb046a5 (diff) | |
download | ruby-f78fcf1010ce62cd4c52d124bd283fa398f5a9f1.tar.gz |
* ext/psych/lib/psych/visitors/yaml_tree.rb: keep a reference to
custom coders so that GC does not impact dumped yaml reference ids.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/psych/lib/psych/visitors/yaml_tree.rb | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed May 16 01:15:45 2012 Aaron Patterson <aaron@tenderlovemaking.com> + + * ext/psych/lib/psych/visitors/yaml_tree.rb: keep a reference to + custom coders so that GC does not impact dumped yaml reference ids. + Tue May 15 23:59:48 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * lib/test/unit.rb (Test::Unit::Options#setup_options): add --color option. diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb index 80af0466eb..646fed71aa 100644 --- a/ext/psych/lib/psych/visitors/yaml_tree.rb +++ b/ext/psych/lib/psych/visitors/yaml_tree.rb @@ -20,6 +20,7 @@ module Psych @st = {} @ss = ss @options = options + @coders = [] @dispatch_cache = Hash.new do |h,klass| method = "visit_#{(klass.name || '').split('::').join('_')}" @@ -406,6 +407,7 @@ module Psych end def dump_coder o + @coders << o tag = Psych.dump_tags[o.class] unless tag klass = o.class == Object ? nil : o.class.name |