[capi-sig] Does Py_False or Py_True need de-referencing if used in a PyObject_Compare?
ideasman42 at gmail.com
Sat Dec 15 15:46:50 CET 2012
On Fri, Dec 14, 2012 at 3:21 AM, Robert Steckroth
<robertsteckroth at gmail.com> wrote:
> Does the below statement have a memory leak?
> if ( PyObject_Compare(update_var, Py_False)
> Do I need to assign the Py_False first and DECREF it, or is the above
> snippet ok alone.
The python api docs will often say if they use/steal references.
If your not sure you could just printf("%d\n", Py_REFCNT(Py_False));
before and after calling.
More information about the capi-sig