bpo-30860: Fix a refleak. (#3567)

Resolves bpo-31420.

(This was accidentally reverted when in #3565.)
This commit is contained in:
Eric Snow 2017-09-14 00:35:58 -07:00 committed by GitHub
parent 93c92f7d1d
commit dae0276bb6
7 changed files with 47 additions and 43 deletions

View file

@ -727,14 +727,13 @@ PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
/* Py_REF_DEBUG also controls the display of refcounts and memory block
* allocations at the interactive prompt and at interpreter shutdown
*/
PyAPI_FUNC(PyObject *) _PyDebug_XOptionShowRefCount(void);
PyAPI_FUNC(void) _PyDebug_PrintTotalRefs(void);
#define _PY_DEBUG_PRINT_TOTAL_REFS() _PyDebug_PrintTotalRefs()
#else
#define _Py_INC_REFTOTAL
#define _Py_DEC_REFTOTAL
#define _Py_REF_DEBUG_COMMA
#define _Py_CHECK_REFCNT(OP) /* a semicolon */;
#define _PY_DEBUG_PRINT_TOTAL_REFS()
#endif /* Py_REF_DEBUG */
#ifdef COUNT_ALLOCS