Subj : Re: Custom finalization for functions To : Alain Frisch From : Brendan Eich Date : Tue May 24 2005 01:31 pm Alain Frisch wrote: > I need to be able to detect when a JSFunction that I created is > finalized. I don't see immediatly how to do that with JS_SetGCCallback. > Is there a way to retrieve all the objects just before they are finalized? If your closure array has a back-pointer from each array element to each JS function object, then you can use the GC callback's GC_MARK_END call to iterate over the array, calling JS_IsAboutToBeFinalized(cx, funobj) on each. This is what XPConnect does (sorry, my allusion to it in a previous message was unclear). /be .