Creates a standalone finalizer function for Object, which assumes only that the base package is available.
.makeObjectFinalizer(this, reloadRoo=TRUE)
The Object
to be finalized.
If TRUE
, the finalizer will try to temporary
reload the R.oo package if not loaded.
Returns a function
that can be passed to reg.finalizer
().
The created finalizer is reentrant.
This is always the case when the R.oo package is already
loaded when the finalizer is called.
It is also always the case on R v2.15.2 Patched r61487 and beyond.
In other cases, the finalizer inspects the call stack
(via sys.calls
()) to check whether parse
()
has been called or not. If it is on the call stack, it indicates
that parse
() triggered the garbage collection, and
the R.oo package will not be reloaded in order to
avoid risking parse
() being called again.