[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] Finalizers



It is working in general; the problem is it collects in between calls.

I figured out what the problem was; InstallFinalizer() calls GCWrite () to make a reference between the object getting a finalizer and the Finalizer object. GCWrite() checks that the parent (the object getting a finalizer) is black, which it isn't because I had just created it with instantiateObject() (in the case of .alloc at least). The solution is to manually call toGrey() to force the reference. Does this sound alright? Do you know of a better way to do this that avoids using finalizers?

Thanks,
Ryan