We don’t support finalizers yet, but it shouldn’t be too much work to
make ObjectSpace#define_finalizer work with Ruby objects. We might also
consider providing some means to override CLR Finalize method.
Tomas
From: [email protected]
[mailto:[email protected]] On Behalf Of Jimmy
Schementi
Sent: Monday, January 11, 2010 12:45 AM
To: [email protected]
Subject: Re: [Ironruby-core] Adding a finalizer to a ruby object
Ivan, I’m not sure but I’ve asked the rest of the team and someone will
get back to you shortly.
~Jimmy
On Jan 11, 2010, at 12:00 AM, “Ivan Porto C.”
<[email protected]mailto:[email protected]> wrote:
I specifically wanted to find a counterpart for this C#
public class SomeClass {
private object _unmanagedResource;
public SomeClass(object unmanagedResource){
_unmanagedResource = unmanagedResource;
}
~SomeClass(){
_unmanagedResource.Cleanup();
_unmanagedResource = null;
}
}
I was writing about the dispose pattern and wanted to include a full
counterpart implementation with a finalizer for unmanaged resources.
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto C.
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)
On Mon, Jan 11, 2010 at 6:12 AM, Sam Clopton
<[email protected]mailto:[email protected]> wrote:
Ivan Porto carrero wrote:
either
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
[email protected]mailto:[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core
Ironruby-core mailing list
[email protected]mailto:[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core