Skip to content

Commit

Permalink
Fix memory leak (#558)
Browse files Browse the repository at this point in the history
Since `PyObject_Call` returns a new reference, we don't need to
increment the reference count.

closes #542
  • Loading branch information
tkf authored and stevengj committed Sep 6, 2018
1 parent 49029e0 commit 0f685cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyfncall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function __pycall!(ret::PyObject, pyargsptr::PyPtr, o::Union{PyObject,PyPtr},
retptr = @pycheckn ccall((@pysym :PyObject_Call), PyPtr, (PyPtr,PyPtr,PyPtr), o,
pyargsptr, kw)
pydecref_(ret.o)
ret.o = pyincref_(retptr)
ret.o = retptr
finally
sigatomic_end()
end
Expand Down

0 comments on commit 0f685cf

Please sign in to comment.