From lukas.stadler at oracle.com  Thu Sep 21 16:41:04 2017
From: lukas.stadler at oracle.com (Lukas Stadler)
Date: Thu, 21 Sep 2017 16:41:04 +0200
Subject: [Rd] calling R API functions after engine shutdown
Message-ID: <D76B3D36-9D77-4B93-8988-BCB21D927046@oracle.com>

Hi!

We?ve recently come across an example where a package (minqa) creates an Rcpp Function object in a static variable.
This causes R_ReleaseObject to be called by the destructor at a very late point in time - as part of the system exit function:

static Function cf("c");

I?m wondering if that is considered to be ?safe??
Is the R engine supposed to stay in a state where calls to API functions are valid, even after it has shut down?
It probably only ever happens with the ReleaseObject function, but even that could cause problems, e.g., with more elaborate refcounting schemes.

- Lukas


[Rd] calling R API functions after engine shutdown
Lukas Stadler