From 1de3908c7991845d12368c8887c2b330c5205889 Mon Sep 17 00:00:00 2001 From: Alexander Barth Date: Wed, 13 Sep 2023 14:44:22 +0200 Subject: [PATCH] avoid printing during finalizer --- src/dataset.jl | 2 +- src/types.jl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dataset.jl b/src/dataset.jl index e673cda1..6a7db5ba 100644 --- a/src/dataset.jl +++ b/src/dataset.jl @@ -298,7 +298,7 @@ Close the NCDataset `ds`. All pending changes will be written to the disk. """ function Base.close(ds::NCDataset) - @debug "closing netCDF NCDataset $(ds.ncid) $(NCDatasets.path(ds))" + #@debug "closing netCDF NCDataset $(ds.ncid) $(NCDatasets.path(ds))" try nc_close(ds.ncid) catch err diff --git a/src/types.jl b/src/types.jl index c89fb293..336d8791 100644 --- a/src/types.jl +++ b/src/types.jl @@ -89,9 +89,9 @@ mutable struct NCDataset{TDS} <: AbstractNCDataset where TDS <: Union{AbstractNC ) function _finalize(ds) - @debug begin - ccall(:jl_, Cvoid, (Any,), "finalize $ncid $timeid \n") - end + #@debug begin + # ccall(:jl_, Cvoid, (Any,), "finalize $ncid $timeid \n") + #end # only close open root group if (ds.ncid != -1) && (ds.parentdataset == nothing) close(ds) @@ -110,7 +110,7 @@ mutable struct NCDataset{TDS} <: AbstractNCDataset where TDS <: Union{AbstractNC initboundsmap!(ds) end timeid = Dates.now() - @debug "add finalizer $ncid $(timeid)" + #@debug "add finalizer $ncid $(timeid)" finalizer(_finalize, ds) return ds end