On Tue, May 6, 2014 at 11:53 AM, Jerome MARQUET
<[email protected]>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*
> *}*
>
>
> and I observe that it is called when dyn.unload(myModule) is called. But
> the function is not called when R is exited. I wonder if there is a similar
> function (like R_exit_packgName or R_quit_packageName) that is called when
> R is exited ?
>

A workaround would be to register a finalizer with onexit=TRUE on a dummy
object. See reg.finalizer.

THK


>
> _______________________________________________
> Rcpp-devel mailing list
> [email protected]
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>



-- 
http://www.keittlab.org/
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to