Skip to content
Prev 21747 / 63458 Next

stop R mainloop without calling exit(1)

This is already covered in the R-devel version of R: please consult
`Writing R Extensions' in that version.
On Thu, 31 Aug 2006, Thomas Kelder wrote:

            
But that's not true.  The documented way is

setup_Rmainloop
run a loop (which can return)
end_Rmainloop

The problem was that the only documented way to shut R down cleanly was 
end_Rmainloop (which did call exit), whereas there now is Rf_endEmbeddedR.
That's because you called end_Rmainloop, possibly by calling 
run_Rmainloop rather than taking control of the loop.

It seems that almost all users of embedded R did not call end_Rmainloop, 
and I met this when creating a common embedding interface for Unix and 
Windows versions of R: the Windows widgets (such as the graphics device) 
do need to be told to shut down.

[...]