From ripley at stats.ox.ac.uk  Wed Jul 27 09:13:37 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 27 Jul 2005 08:13:37 +0100 (BST)
Subject: [Rd] Error registering finalizer
In-Reply-To: <Pine.OSF.4.58.0507261943150.87208@odin.mdacc.tmc.edu>
References: <Pine.OSF.4.58.0507261702310.390023@odin.mdacc.tmc.edu>
	<Pine.OSF.4.58.0507261943150.87208@odin.mdacc.tmc.edu>
Message-ID: <Pine.LNX.4.61.0507270811260.21618@gannet.stats>

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



[Rd] Error registering finalizer
Prof Brian Ripley