Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, for

tp_clear methods.
This commit is contained in:
Thomas Wouters 2006-04-15 17:28:34 +00:00
parent ed8f783126
commit edf17d8798
8 changed files with 30 additions and 57 deletions

View file

@ -81,8 +81,7 @@ cell_traverse(PyCellObject *op, visitproc visit, void *arg)
static int
cell_clear(PyCellObject *op)
{
Py_XDECREF(op->ob_ref);
op->ob_ref = NULL;
Py_CLEAR(op->ob_ref);
return 0;
}