File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,8 @@ namespace Rcpp{
321
321
Armor<SEXP> env ;
322
322
try {
323
323
SEXP getNamespaceSym = Rf_install (" getNamespace" );
324
- env = Rcpp_eval ( Rf_lang2 (getNamespaceSym, Rf_mkString (package.c_str ()) ) ) ;
324
+ Shield<SEXP> package_str ( Rf_mkString (package.c_str ()) );
325
+ env = Rcpp_eval ( Rf_lang2 (getNamespaceSym, package_str) ) ;
325
326
} catch ( ... ){
326
327
throw no_such_namespace ( package ) ;
327
328
}
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ SEXP get_rcpp_cache() {
93
93
if ( ! Rcpp_cache_know ){
94
94
95
95
SEXP getNamespaceSym = Rf_install (" getNamespace" ); // cannot be gc()'ed once in symbol table
96
- Rcpp::Shield<SEXP> RCPP ( Rf_eval (Rf_lang2 ( getNamespaceSym, Rf_mkString (" Rcpp" ) ), R_GlobalEnv) ) ;
96
+ Rcpp::Shield<SEXP> RcppString ( Rf_mkString (" Rcpp" ) );
97
+ Rcpp::Shield<SEXP> RCPP ( Rf_eval (Rf_lang2 ( getNamespaceSym, RcppString ), R_GlobalEnv) ) ;
97
98
98
99
Rcpp_cache = Rf_findVarInFrame ( RCPP, Rf_install (" .rcpp_cache" ) ) ;
99
100
Rcpp_cache_know = true ;
You can’t perform that action at this time.
0 commit comments