Ivan Porto carrero wrote:
> 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


What about using a proc, or block and running finalize after yield or
proc.call?

-Sam
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to