We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b58458 commit 2121364Copy full SHA for 2121364
src/JlWrap/objectarray.jl
@@ -42,9 +42,11 @@ end
42
43
@propagate_inbounds function Base.getindex(x::PyObjectArray, i::Integer...)
44
@boundscheck checkbounds(x, i...)
45
- @inbounds ptr = x.ptrs[i...]
46
- ptr == C_NULL && throw(UndefRefError())
47
- return pynew(incref(ptr))
+ Base.GC.@preserve x begin
+ @inbounds ptr = x.ptrs[i...]
+ ptr == C_NULL && throw(UndefRefError())
48
+ return pynew(incref(ptr))
49
+ end
50
end
51
52
@propagate_inbounds function Base.setindex!(x::PyObjectArray, v, i::Integer...)
0 commit comments