From: Paul Brannan Date: 2001-11-30T05:41:18+09:00 Subject: [ruby-talk:26958] some more finalizer weirdness If I do this: class Foo def initialize ObjectSpace.define_finalizer(self, self.class.method(:finalize).to_proc) end def self.finalize(id) puts "finalizer called" end end class Bar def initialize @obj = Foo.new end def foo @obj = nil GC.start # puts "foo" end end def main b = Bar.new b.foo end main() puts "GC starting" GC.start puts "leaving" Then I get this: finalizer called GC starting leaving But if I comment out the line "puts 'foo'", then I get: foo GC starting finalizer called leaving I don't know what's happening here, but my first suspicion is that it has something to do with bindings (?). Any ideas? Paul