aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-01-16 10:33:06 +0100
committerThomas White <taw@physics.org>2024-02-06 16:59:35 +0100
commit57ed401c57e8a7548cb21d16495495446e070e13 (patch)
tree61d0f5497e882e33a2e1a8f61b238dbccd4df19d
parentd0787517583955eb0d9391b1bd14764198e83903 (diff)
Julia: Forbid non-deep copying of a PeakList
We cannot have two PeakList objects pointing at the same underlying ImageFeatureList.
-rw-r--r--julia/CrystFEL/src/peaklist.jl2
1 files changed, 2 insertions, 0 deletions
diff --git a/julia/CrystFEL/src/peaklist.jl b/julia/CrystFEL/src/peaklist.jl
index d4354977..9eedad27 100644
--- a/julia/CrystFEL/src/peaklist.jl
+++ b/julia/CrystFEL/src/peaklist.jl
@@ -30,6 +30,8 @@ function PeakList()
end
+Base.copy(::PeakList) = throw(ErrorException("Cannot copy(::PeakList), must deepcopy"))
+
function Base.deepcopy(peaklist::PeakList)
out = @ccall libcrystfel.image_feature_list_copy(peaklist.internalptr::Ptr{InternalPeakList})::Ptr{InternalPeakList}
if out == C_NULL