Re: [Rcpp-devel] How to define a function called when R exited

2014-05-07 Thread Tim Keitt
On Tue, May 6, 2014 at 11:53 AM, Jerome MARQUET wrote: > Hello, > > I am building a package "myModule" and would like to define a function > that will be called when R is exited. > > So I defined a function > > *RcppExport void R_unload_mlxComputeR(DllInfo *info)* > *{* > *// Do sthg* > *}* >

Re: [Rcpp-devel] How to define a function called when R exited

2014-05-06 Thread Jamie Olson
I believe you're looking for `.Last`. Unfortunately there's no way to set `on.exit(...)` for the global environment. >From the ?quit documentation: Immediately before terminating, .Last() is executed if the function .Last exists and runLast is true. If in interactive use there are errors in the .

[Rcpp-devel] How to define a function called when R exited

2014-05-06 Thread Jerome MARQUET
Hello, I am building a package "myModule" and would like to define a function that will be called when R is exited. So I defined a function /RcppExport void R_unload_mlxComputeR(DllInfo *info)// //{// //// Do sthg// //}// / and I observe that it is called when dyn.unload(