Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Additional clean shutdown actions added per note from Prof. B. Ripley.

  • Loading branch information...
commit adca941316e706b551bd2bc6edfd0909fe34f91f 1 parent 67be537
postgres authored
Showing with 12 additions and 1 deletion.
  1. +4 −0 plr.c
  2. +8 −1 plr.h
View
4 plr.c
@@ -233,6 +233,10 @@ plr_cleanup(void)
char *buf;
char *tmpdir = getenv("R_SESSION_TMPDIR");
+ R_dot_Last();
+ R_RunExitFinalizers();
+ KillAllDevices();
+
if(tmpdir)
{
/*
View
9 plr.h
@@ -63,6 +63,7 @@
#include "R.h"
#include "Rinternals.h"
#include "Rdefines.h"
+#include "Rdevices.h"
#include "Rversion.h"
#ifdef ERROR
@@ -144,7 +145,13 @@ extern SEXP R_ParseVector(SEXP, int, int *);
extern void R_PreserveObject(SEXP);
extern void R_ReleaseObject(SEXP);
-#else
+/* in main.c */
+extern void R_dot_Last(void);
+
+/* in memory.c */
+extern void R_RunExitFinalizers(void);
+
+#else /* R_VERSION >= 1.8.0 */
#include "R_ext/Parse.h"
#define R_PARSEVECTOR(a_, b_, c_) R_ParseVector(a_, b_, (ParseStatus *) c_)
Please sign in to comment.
Something went wrong with that request. Please try again.