Skip to content

Commit

Permalink
Cope with numpy memleak (e.g. np.array([1,2,3]) < 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mknkmyzk authored and mrkn committed Aug 28, 2023
1 parent 8f76306 commit 799205d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/pycall/pycall.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,9 @@ pycall_libpython_helpers_m_compare(VALUE mod, VALUE op, VALUE pyptr_a, VALUE pyp
if (!res) {
pycall_pyerror_fetch_and_raise("PyObject_RichCompare in pycall_libpython_helpers_m_compare");
}

return pycall_pyobject_to_ruby(res);
VALUE obj = pycall_pyobject_to_ruby(res);
pycall_Py_DecRef(res);
return obj;
}

static int is_pyobject_wrapper(VALUE obj);
Expand Down

0 comments on commit 799205d

Please sign in to comment.