summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/visitors
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-15 16:24:31 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-15 16:24:31 +0000
commitf78fcf1010ce62cd4c52d124bd283fa398f5a9f1 (patch)
tree2290d40b550238f65113d8f9fe7262c3dab3f481 /ext/psych/lib/psych/visitors
parent5bca86dde251a9c03330737546256a9efcb046a5 (diff)
* 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
Diffstat (limited to 'ext/psych/lib/psych/visitors')
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb2
1 files changed, 2 insertions, 0 deletions
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