Skip to content

Commit 1c0324b

Browse files
committed
make sure that string.bytes are referenced until thread resume
1 parent 649dccc commit 1c0324b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,12 @@ def print_hash(hash)
130130

131131
def print_string(string)
132132
print_element("variables") do
133-
print_variable('bytes', string.bytes.to_a, 'instance') if string.respond_to?('bytes')
134-
print_variable('encoding', string.encoding, 'instance') if string.respond_to?('encoding')
133+
if string.respond_to?('bytes')
134+
bytes = string.bytes.to_a
135+
InspectCommand.reference_result(bytes)
136+
print_variable('bytes', bytes, 'instance')
137+
end
138+
print_variable('encoding', string.encoding, 'instance') if string.respond_to?('encoding')
135139
end
136140
end
137141

0 commit comments

Comments
 (0)