[R] How to define a destructor of an object?

Shin, Daehyok sdhyok at catchlab.org
Tue May 18 19:31:56 CEST 2004


Thanks, Thomas. This is exactly what I want.
I am wondering why there is no explicit mention about this function,
such as, in the help document of gc().


Daehyok Shin (Peter)

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Thomas Lumley
> Sent: Tuesday, May 18, 2004 AM 10:29
> To: Shin, Daehyok
> Cc: R, Help
> Subject: Re: [R] How to define a destructor of an object?
>
>
> On Tue, 18 May 2004, Shin, Daehyok wrote:
>
> > Is there any way to define a destructor method of an object,
> > which is called automatically when garbage collector reclaims it?
> >
>
> yes, there is support for finalizers at both the C and R levels. For the R
> level see ?reg.finalizer. I thought there was documentation for the C
> stuff on developer.r-project.org, but I can't see it now.
>
> 	-thomas
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list