Skip to content

Commit

Permalink
make sure to close sink() before closing the text connection
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed May 6, 2024
1 parent 0787062 commit 0e26623
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: xfun
Type: Package
Title: Supporting Functions for Packages Maintained by 'Yihui Xie'
Version: 0.43.13
Version: 0.43.14
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("Wush", "Wu", role = "ctb"),
Expand Down
2 changes: 1 addition & 1 deletion R/record.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ record = function(
out = NULL
con = textConnection('out', 'w', local = TRUE)
on.exit(close(con))
sink(con); on.exit(sink(), add = TRUE)
sink(con); on.exit(sink(), add = TRUE, after = FALSE)
expr # lazy evaluation
on.exit() # if no error occurred, clear up previous on-exit calls
sink()
Expand Down

0 comments on commit 0e26623

Please sign in to comment.