From: Marko Luukkainen Date: Wed, 17 Aug 2022 15:42:07 +0000 (+0300) Subject: Exporting TG files creates temporary files without removing them. X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F4918%2F1;p=simantics%2Fplatform.git Exporting TG files creates temporary files without removing them. gitlab #858 Change-Id: Ie0da930769e275f72577363fef98bdc65ea69ff4 --- diff --git a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphs.java b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphs.java index 7b1a17704..42bae14bf 100644 --- a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphs.java +++ b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphs.java @@ -494,7 +494,7 @@ public class TransferableGraphs { private static void writeTransferableGraph(RequestProcessor processor, final TransferableGraphSource source, final RandomAccessBinary out, TGStatusMonitor monitor) throws Exception { long start = System.nanoTime(); - + try { final Serializer datatypeSerializer = Bindings.getSerializerUnchecked(Datatype.class); final Serializer identitySerializer = Bindings.getSerializerUnchecked(Identity.class); final Serializer extensionSerializer = Bindings.getSerializerUnchecked(Extensions.class); @@ -595,6 +595,9 @@ public class TransferableGraphs { } } }); + } finally { + source.close(); + } long end = System.nanoTime(); LOGGER.info("Wrote transferable graph in {} seconds.", 1e-9*(end-start));