Hi

How do I add a finalizer to a ruby object?

I've tried using ObjectSpace and define_finalizer.
But the proc never got executed when I called ObjectSpace.garbage_collect
Calling System::GC.collect had the same outcome

and implementing a Finalize method doesn't seem to have any effect either

class MyClass

  def Finalize
    puts "in Finalize"
  end

  def finalize
    puts "in lower finalize"
  end

end

MyClass.new
System::GC.collect System::GC.max_generation,
System::GCCollectionMode.forced
#ObjectSpace.garbage_collect

Thanks
---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero
Blog: http://flanders.co.nz
Google Wave: portocarrero.i...@googlewave.com
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to