[Rd] Error registering finalizer

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jul 27 09:13:37 CEST 2005

On Tue, 26 Jul 2005, Paul Roebuck wrote:

> On Tue, 26 Jul 2005, Paul Roebuck wrote:
>> What exactly is a reference object? I'm getting this error
>> message attempting to register a finalizer:
>>         can only weakly reference/finalize reference objects
> Still don't have an explanation for the above but the code
> now works with the following mods.
> -static void ProbesetGE_finalizer(SEXP vntData)
> +static void ProbesetGE_finalizer(SEXP vntHandle)
> -R_RegisterCFinalizer(vntData, (R_CFinalizer_t)ProbesetGE_finalizer);
> +R_RegisterCFinalizer(vntHandle, (R_CFinalizer_t)ProbesetGE_finalizer);
> Original thought was that a finalizer was a routine that
> ran prior to an object's destruction (like a destructor).

Do you have a reference for where you got that from?

> Apparently, only certain objects can have finalizers.

Yes.  See http://www.stat.uiowa.edu/~luke/R/references.html (linked off 
the developer site).

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list