]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Exporting TG files creates temporary files without removing them. 18/4918/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 17 Aug 2022 15:42:07 +0000 (18:42 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Wed, 17 Aug 2022 15:42:07 +0000 (18:42 +0300)
gitlab #858

Change-Id: Ie0da930769e275f72577363fef98bdc65ea69ff4

bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphs.java

index 7b1a177045a0f4537299282f7a07c7e50fc8c32c..42bae14bf0a989b545fac4980c831b159e489fae 100644 (file)
@@ -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));