Skip to content

Commit 13c0791

Browse files
author
Christopher Doris
committed
avoid try/catch in finalizers
1 parent cba777a commit 13c0791

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/PyBuffer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mutable struct PyBuffer
2626
b = new(info)
2727
finalizer(b) do b
2828
if CONFIG.isinitialized
29-
err = with_gil() do
29+
err = with_gil(false) do
3030
C.PyBuffer_Release(pointer(b.info))
3131
end
3232
check(err)

src/PyObjectArray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mutable struct PyObjectArray{N} <: AbstractArray{PyObject, N}
44
x = new{N}(fill(CPyPtr(C_NULL), dims))
55
finalizer(x) do x
66
if CONFIG.isinitialized
7-
with_gil() do
7+
with_gil(false) do
88
for ptr in x.ptrs
99
C.Py_DecRef(ptr)
1010
end

src/object.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mutable struct PyObject
1414
if CONFIG.isinitialized
1515
ptr = getfield(o, :ptr)
1616
if ptr != C_NULL
17-
with_gil() do
17+
with_gil(false) do
1818
C.Py_DecRef(ptr)
1919
end
2020
end

0 commit comments

Comments
 (0)