From a4931378df32bccd32267cb5092e2be55e56122b Mon Sep 17 00:00:00 2001 From: Caleb Hulbert Date: Thu, 22 Feb 2024 13:07:49 -0500 Subject: [PATCH] fix: output stream on LockedWriters where not closing themselves --- .../janelia/saalfeldlab/n5/s3/AmazonS3KeyValueAccess.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/janelia/saalfeldlab/n5/s3/AmazonS3KeyValueAccess.java b/src/main/java/org/janelia/saalfeldlab/n5/s3/AmazonS3KeyValueAccess.java index ce40cef..b3aa067 100644 --- a/src/main/java/org/janelia/saalfeldlab/n5/s3/AmazonS3KeyValueAccess.java +++ b/src/main/java/org/janelia/saalfeldlab/n5/s3/AmazonS3KeyValueAccess.java @@ -609,7 +609,11 @@ public Reader newReader() throws IOException { public OutputStream newOutputStream() throws IOException { checkWritable(); - return new S3OutputStream(); + final S3OutputStream s3Out = new S3OutputStream(); + synchronized (resources) { + resources.add(s3Out); + } + return s3Out; } @Override