Skip to content

Commit

Permalink
Add a GC.@preserve when calling unsafe_transcode! (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkitti authored May 28, 2024
1 parent a32fdfe commit 8541891
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transcode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ function transcode!(
Base.mightalias(input.data, output.data) && error(
"input and outbut buffers must be independent"
)
unsafe_transcode!(output, codec, input)
# GC.@preserve since unsafe_transcode! may convert to raw pointers
GC.@preserve input output codec unsafe_transcode!(output, codec, input)
end

"""
Expand Down

0 comments on commit 8541891

Please sign in to comment.