diff options
Diffstat (limited to 'julia/CrystFEL/src/peaklist.jl')
-rw-r--r-- | julia/CrystFEL/src/peaklist.jl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/julia/CrystFEL/src/peaklist.jl b/julia/CrystFEL/src/peaklist.jl index 1735de5e..a676a7bf 100644 --- a/julia/CrystFEL/src/peaklist.jl +++ b/julia/CrystFEL/src/peaklist.jl @@ -25,7 +25,12 @@ function PeakList() if out == C_NULL throw(ArgumentError("Failed to create peak list")) end - PeakList(out, false) + finalizer(PeakList(out, false)) do pl + if !pl.in_image + @ccall libcrystfel.image_feature_list_free(pl.internalptr::Ptr{InternalPeakList})::Cvoid + # else it belongs to the image structure + end + end end |