Skip to content

Commit

Permalink
* ext/psych/lib/psych/visitors/yaml_tree.rb: keep a reference to
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
tenderlove committed May 15, 2012
1 parent 5bca86d commit f78fcf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -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.
Expand Down
2 changes: 2 additions & 0 deletions ext/psych/lib/psych/visitors/yaml_tree.rb
Expand Up @@ -20,6 +20,7 @@ def initialize options = {}, emitter = TreeBuilder.new, ss = ScalarScanner.new
@st = {}
@ss = ss
@options = options
@coders = []

@dispatch_cache = Hash.new do |h,klass|
method = "visit_#{(klass.name || '').split('::').join('_')}"
Expand Down Expand Up @@ -406,6 +407,7 @@ def register target, yaml_obj
end

def dump_coder o
@coders << o
tag = Psych.dump_tags[o.class]
unless tag
klass = o.class == Object ? nil : o.class.name
Expand Down

0 comments on commit f78fcf1

Please sign in to comment.