From: Robert Klemme Date: 2007-05-03T00:00:09+09:00 Subject: Re: It doesn't produce any output! On 02.05.2007 16:50, Yusuf Celik wrote: > Hi, > I wonder if something is wrong with the following code. > Because, it doesn't produce any output. > BTW, I am new to Ruby. > > Regards > yc > > > include ObjectSpace > > a=b=c="A" > > define_finalizer(a, proc {|id| puts "Finalizer > #{ObjectSpace._id2ref(id)} on #{id}" }) > define_finalizer(b, proc {|id| puts "Finalizer > #{ObjectSpace._id2ref(id)} on #{id}" }) > define_finalizer(c, proc {|id| puts "Finalizer > #{ObjectSpace._id2ref(id)} on #{id}" }) > Your finalizers lock the object in memory. You can find a recent discussion about the topic in the archives. Please note also that you are defining three finalizers for a single instance which is probably not what you want. Kind regards robert