[ruby-talk:00187] Re: finalizer help please

From: matz@... (Yukihiro Matsumoto)
Date: 1999-01-16 01:01:49 UTC
List: ruby-talk #187
Hi.

In message "[ruby-talk:00186] Re: finalizer help please"
    on 99/01/15, Clemens Hintze <c.hintze@gmx.net> writes:

|The second should be, that your destructor should never be called, I
|think. I have done a very similar approach for my first module. Matz
|has told me then, that my destructor helds a pointer to self, means to
|my instance I wish to finalize! Due to that fact the GC will never
|recognize my instance as unused. So no finalization should take place,
|as there is a pointer to my instance all the time. And for GC
|pointer-to-instance means "used".

Indeed.  You'd better define finalizers in you C code.

BTW, I'm planning to add Java style finalizers to Ruby, although not
in near future.  Maybe in Ruby 2.1 or 3.0.

                                                matz.

In This Thread

Prev Next