diff --git a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java index 51640f22d05..c1f1705b626 100644 --- a/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java +++ b/engine/table/src/main/java/io/deephaven/engine/util/AbstractScriptSession.java @@ -26,6 +26,7 @@ import java.io.File; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.function.Function; @@ -41,26 +42,27 @@ public abstract class AbstractScriptSession export : exports) { - export.cancel(); + if (exports != null) { + for (ExportObject export : exports) { + export.cancel(); + } + exports = null; + } + if (executionContext != null) { + executionContext.close(); + executionContext = null; } - exports = null; - executionContext.close(); - executionContext = null; super.tearDown(); }