Skip to content

Commit

Permalink
Make sure resources get closed in cache when NetcdfDataset (e.g. aggr…
Browse files Browse the repository at this point in the history
…egation) is converted to builder
  • Loading branch information
tdrwenski committed Feb 7, 2024
1 parent 28a4530 commit d3bf12c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cdm/core/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -1657,8 +1657,7 @@ private Builder<?> addLocalFieldsToBuilder(Builder<? extends Builder<?>> b) {
this.coordSys.forEach(sys -> b.coords.addCoordinateSystem(sys.toBuilder()));
this.coordTransforms.forEach(trans -> b.coords.addCoordinateTransform(trans.toBuilder()));

b.setOrgFile(this.orgFile).setConventionUsed(this.convUsed).setEnhanceMode(this.enhanceMode)
.setAggregation(this.agg);
b.setOrgFile(this).setConventionUsed(this.convUsed).setEnhanceMode(this.enhanceMode).setAggregation(this.agg);

return (Builder<?>) super.addLocalFieldsToBuilder(b);
}
Expand Down

0 comments on commit d3bf12c

Please sign in to comment.