Skip to content

Commit 8541891

Browse files
authored
Add a GC.@preserve when calling unsafe_transcode! (#216)
1 parent a32fdfe commit 8541891

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/transcode.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ function transcode!(
125125
Base.mightalias(input.data, output.data) && error(
126126
"input and outbut buffers must be independent"
127127
)
128-
unsafe_transcode!(output, codec, input)
128+
# GC.@preserve since unsafe_transcode! may convert to raw pointers
129+
GC.@preserve input output codec unsafe_transcode!(output, codec, input)
129130
end
130131

131132
"""

0 commit comments

Comments
 (0)