aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/stackrefs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/stackrefs.c')
-rw-r--r--Python/stackrefs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/stackrefs.c b/Python/stackrefs.c
index 2e889b19bf3..a7693ba75c5 100644
--- a/Python/stackrefs.c
+++ b/Python/stackrefs.c
@@ -1,6 +1,7 @@
#include "Python.h"
+#include "pycore_object.h"
#include "pycore_stackref.h"
#if !defined(Py_GIL_DISABLED) && defined(Py_STACKREF_DEBUG)
@@ -175,8 +176,16 @@ _Py_stackref_report_leaks(PyInterpreterState *interp)
int leak = 0;
_Py_hashtable_foreach(interp->open_stackrefs_table, report_leak, &leak);
if (leak) {
+ fflush(stdout);
Py_FatalError("Stackrefs leaked.");
}
}
+void
+PyStackRef_CLOSE_SPECIALIZED(_PyStackRef ref, destructor destruct)
+{
+ PyObject *obj = _Py_stackref_close(ref);
+ _Py_DECREF_SPECIALIZED(obj, destruct);
+}
+
#endif