aboutsummaryrefslogtreecommitdiff
path: root/julia/CrystFEL
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-01-20 15:37:31 +0100
committerThomas White <taw@physics.org>2024-02-06 16:59:35 +0100
commit03612564815811e495a6b6a595defc834cd310e9 (patch)
treecd7ece42846ca8c19e9d39a6555f5dd147b5b112 /julia/CrystFEL
parent8fe6287bfc5335c47140fe7ba745de14b1376d2c (diff)
Julia: Fix image.peaklist memory management
Diffstat (limited to 'julia/CrystFEL')
-rw-r--r--julia/CrystFEL/src/image.jl3
1 files changed, 2 insertions, 1 deletions
diff --git a/julia/CrystFEL/src/image.jl b/julia/CrystFEL/src/image.jl
index f858dfa7..5b443d05 100644
--- a/julia/CrystFEL/src/image.jl
+++ b/julia/CrystFEL/src/image.jl
@@ -152,12 +152,13 @@ function set_peaklist(image, new_pl)
assert_type(new_pl, PeakList)
idata = unsafe_load(image.internalptr)
- if (idata.owns_peaklist == 0) && (idata.peaklist != C_NULL)
+ if (idata.owns_peaklist == 1) && (idata.peaklist != C_NULL)
@ccall libcrystfel.image_feature_list_free(idata.peaklist::Ptr{InternalPeakList})::Cvoid
end
idata.peaklist = new_pl.internalptr
idata.owns_peaklist = 0
unsafe_store!(image.internalptr, idata)
+ setfield!(image, :peaklist, new_pl)
end