From 2b8d4ed472bd7bd4fef2ab2639d056688bd0bb8d Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Wed, 25 Aug 2010 15:55:41 +0100 Subject: [PATCH] ensure that the fifo is closed in printToString() Whoops. Good to know that I can make the same basic stream mistakes in any language. --- swank.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/swank.R b/swank.R index 1c1633d..05b1c78 100644 --- a/swank.R +++ b/swank.R @@ -230,10 +230,8 @@ writeSexpToString <- function(obj) { printToString <- function(val) { f <- fifo("") - sink(f) - print(val) - sink() - readLines(f) + tryCatch({ sink(f); print(val); sink(); readLines(f) }, + finally=close(f)) } `swank:connection-info` <- function (io, sldbState) { -- 2.30.2