Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue935 #940

Merged
merged 2 commits into from Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,15 @@
* R/Attributes.R: better handle pre-existing RcppExports.cpp,
RcppExports.R when calling compileAttributes()

2019-02-09 Ralf Stubner <ralf.stubner@daqana.com>

* Rcpp-modules.Rmd: Added example for .factory

2019-01-31 Dirk Eddelbuettel <edd@debian.org>

* inst/include/Rcpp/protection/Shelter.h (Rcpp): Only increase
nprotected count if object is not NULL (suggested by Stepan Sindelar)

2018-12-26 Zhuoer Dong <dongzhuoer@mail.nankai.edu.cn>

* vignettes/Rcpp-quickref.Rmd: Fix three bugs: use `Named()`, define
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 1.0.0.1
Version: 1.0.0.2
Date: 2018-11-11
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
Nathan Russell, Douglas Bates and John Chambers
Expand Down
4 changes: 3 additions & 1 deletion inst/NEWS.Rd
Expand Up @@ -17,12 +17,14 @@
\item A new plugin was added for C++20 (Dirk in \ghpr{927})
\item Fixed an issue where 'stale' symbols could become registered in
RcppExports.cpp, leading to linker errors and other related issues.
(\ghit{733}; \ghit{934})
(Kevin fixing \ghit{733} and \ghit{934})
}
\item Changes in Rcpp Documentation:
\itemize{
\item Three small corrections were added in the 'Rcpp Quickref
vignette (Zhuoer Dong in \ghpr{933} fixing \ghit{932}).
\item The \code{Rcpp-modules} vignette now has documentation for
\code{.factory} (Ralf Stubner in \ghpr{938} fixing \ghit{937}).
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions inst/include/Rcpp/protection/Shelter.h
Expand Up @@ -23,25 +23,25 @@ namespace Rcpp {
template <class T>
class Shelter {
public:
Shelter() : nprotected(0){}
Shelter() : nprotected(0) {}

inline SEXP operator()(SEXP x){
nprotected++;
return Rcpp_protect(x) ;
inline SEXP operator()(SEXP x) {
if (x != R_NilValue) nprotected++;
return Rcpp_protect(x);
}

~Shelter(){
Rcpp_unprotect(nprotected) ;
nprotected = 0 ;
Rcpp_unprotect(nprotected);
nprotected = 0;
}

private:
int nprotected ;
int nprotected;

// not defined on purpose
Shelter(const Shelter&) ;
Shelter& operator=(const Shelter&) ;
} ;
};
}

#endif