Skip to content

Commit 21400f2

Browse files
protect call inside Rcpp::Environment<>::namespace_env(). Potential gc issue.
1 parent 8b5b623 commit 21400f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

inst/include/Rcpp/Environment.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ namespace Rcpp{
374374
try{
375375
SEXP getNamespaceSym = Rf_install("getNamespace");
376376
Shield<SEXP> package_str( Rf_mkString(package.c_str()) );
377-
env = Rcpp_fast_eval(Rf_lang2(getNamespaceSym, package_str), R_GlobalEnv);
377+
Shield<SEXP> call( Rf_lang2(getNamespaceSym, package_str) );
378+
env = Rcpp_fast_eval(call, R_GlobalEnv);
378379
} catch( ... ){
379380
throw no_such_namespace( package ) ;
380381
}

0 commit comments

Comments
 (0)