Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: readODS
Type: Package
Title: Read and Write ODS Files
Version: 2.3.0
Version: 2.3.1
Authors@R:
c(person("Gerrit-Jan", "Schutten", role = c("aut"), email = "[email protected]"),
person("Chung-hong", "Chan", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-6232-7530")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# readODS 2.3.1

## Bug fixes

* Fix #190 a potential GC issue in the vendored cpp11 code, detected by rchk

# readODS 2.3.0

* Use `minty` instead of `readr` to reduce the number of dependencies
Expand Down
11 changes: 11 additions & 0 deletions inst/include/cpp11/r_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,12 +918,23 @@ inline r_vector<T>::operator SEXP() const {
}
if (length_ < capacity_) {
p->data_ = truncate(p->data_, length_, capacity_);
#if R_VERSION >= R_Version(3, 4, 0) && R_VERSION < R_Version(4, 5, 0)
SEXP nms = names();
auto nms_size = Rf_xlength(nms);
if ((nms_size > 0) && (length_ < nms_size)) {
nms = truncate(nms, length_, capacity_);
names() = nms;
}
#else
SEXP nms;
PROTECT(nms = names());
auto nms_size = Rf_xlength(nms);
if ((nms_size > 0) && (length_ < nms_size)) {
nms = truncate(nms, length_, capacity_);
names() = nms;
}
UNPROTECT(1);
#endif
}
return data_;
}
Expand Down