Hi Robert,
It looks like there is no way to explicitly make an S4 object call a
function when it is garbage collected unless you resort to tricks with
reg.finalizer.
It turns out that Prof. Ripley's reply (thanks!!) had enough hints in it
that I was able to get the effect I wanted by using R's
1:36 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Destructor for S4 objects?
Hi,
To write a constructor for an S4 object, you make an initialize method
which will be called by new. But how would I make a destructor method
to
be called when the S4 object is garbage collected? I'm looking
On Sat, 8 Jan 2005, McGehee, Robert wrote:
Adam, I'm about to encounter a very similar problem, so would be curious
if you find a good solution, although your thoughts with reg.finalizer
look promising. The thoughts I had sketched out for tackling this
problem:
1) Have all ancillary resources
Hi,
To write a constructor for an S4 object, you make an initialize method
which will be called by new. But how would I make a destructor method to
be called when the S4 object is garbage collected? I'm looking at
reg.finalizer, but I'm not sure how to make that work for an S4 object.
I want to