ext/pycall/pycall.c in pycall-1.5.0 vs ext/pycall/pycall.c in pycall-1.5.1
- old
+ new
@@ -790,11 +790,12 @@
res = Py_API(PyObject_RichCompare)(pyobj_a, pyobj_b, opid);
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);
VALUE