From: Nat Pryce Date: 2001-09-11T04:07:02+09:00 Subject: [ruby-talk:21040] Re: finalizer question The answer was discussed recently on this list. That discussion has been summarised on the RubyGarden wiki here... http://www.rubygarden.org/ruby?DiscussionOnUsingFinalizers ----- Original Message ----- From: "Joseph McDonald" To: "ruby-talk ML" Sent: Monday, September 10, 2001 7:42 PM Subject: [ruby-talk:21038] finalizer question > > The following code does not print out "doing the final write". > How can I call the "write" method from within the finalizer? > > #!/usr/local/bin/ruby -w > > class A > > def A.finalizer > Proc.new{ write } > end > > def initialize > ObjectSpace.define_finalizer(self, A.finalizer) > end > > def write > puts "doing the final write" > end > end > > a = A.new > > thanks, > -joe > >