M
Michael Neumann
Hi,
Is it intended behaviour, that #dup will assign the same finalizer to
the new object? I thought, #dup will just create a new object, based on
the value, not on other state (as #clone is supposed to do).
a = Array.new
ObjectSpace.define_finalizer(a) { puts "fin" }
b = a.dup
outputs:
fin
fin
Regards,
Michael
Is it intended behaviour, that #dup will assign the same finalizer to
the new object? I thought, #dup will just create a new object, based on
the value, not on other state (as #clone is supposed to do).
a = Array.new
ObjectSpace.define_finalizer(a) { puts "fin" }
b = a.dup
outputs:
fin
fin
Regards,
Michael