File: ets_node_gc.rb

package info (click to toggle)
ruby-libxml 2.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,024 kB
  • ctags: 2,251
  • sloc: xml: 9,628; ansic: 8,409; ruby: 7,806; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# encoding: UTF-8

require './test_helper'

# test of bug 13310, clears MEM2

include GC

inner = XML::Node.new('inner')
save = nil
1.times do
  outer = XML::Node.new('outer')
  outer.child = inner
  1.times do
    doc = XML::Document.new
    doc.root = outer
    # Uncomment the following line and it won't crash
    save = doc
  end
  garbage_collect
end
garbage_collect
puts inner