Skip to content

Commit 0f685cf

Browse files
tkfstevengj
authored andcommitted
Fix memory leak (#558)
Since `PyObject_Call` returns a new reference, we don't need to increment the reference count. closes #542
1 parent 49029e0 commit 0f685cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pyfncall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function __pycall!(ret::PyObject, pyargsptr::PyPtr, o::Union{PyObject,PyPtr},
4444
retptr = @pycheckn ccall((@pysym :PyObject_Call), PyPtr, (PyPtr,PyPtr,PyPtr), o,
4545
pyargsptr, kw)
4646
pydecref_(ret.o)
47-
ret.o = pyincref_(retptr)
47+
ret.o = retptr
4848
finally
4949
sigatomic_end()
5050
end

0 commit comments

Comments
 (0)