Py_Init crash". refchain cannot be cleared because objects can live across
Py_Finalize() and Py_Initialize() if they are kept alive by circular
references.
PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
PyAPI_FUNC(void) _Py_PrintReferences(FILE *);
-PyAPI_FUNC(void) _Py_ResetReferences(void);
#else
/* Without Py_TRACE_REFS, there's little enough to do that we expand code
static PyObject refchain = {&refchain, &refchain};
-void
-_Py_ResetReferences(void)
-{
- refchain._ob_prev = refchain._ob_next = &refchain;
- _Py_RefTotal = 0;
-}
-
void
_Py_NewReference(PyObject *op)
{
#endif
call_ll_exitfuncs();
-
-#ifdef Py_TRACE_REFS
- _Py_ResetReferences();
-#endif /* Py_TRACE_REFS */
}
/* Create and initialize a new interpreter and thread, and return the