Commit 3c3c4bb4 authored by Kevin Modzelewski's avatar Kevin Modzelewski

fix silly ref leak

parent 83965b0c
......@@ -1258,8 +1258,10 @@ extern "C" void _Py_PrintReferenceAddressesCapped(FILE* fp, int max_to_print) no
int found = 0;
for (op = refchain._ob_next; op != &refchain; op = op->_ob_next) {
found++;
if (found <= max_to_print)
fprintf(fp, "%p [%" PY_FORMAT_SIZE_T "d] %s\n", op, op->ob_refcnt, Py_TYPE(op)->tp_name);
if (found <= max_to_print) {
fprintf(fp, "%p [%" PY_FORMAT_SIZE_T "d] %s \033[40mwatch -l ((PyObject*)%p)->ob_refcnt\033[0m\n", op, op->ob_refcnt,
Py_TYPE(op)->tp_name, op);
}
}
if (found > max_to_print) {
fprintf(fp, "%d more found (but not printed)\n", found - max_to_print);
......
......@@ -383,6 +383,7 @@ public:
r->num_type = AST_Num::LONG;
// XXX This is pretty silly:
auto s = _PyLong_Format(o, 10, 0, 0);
AUTO_DECREF(s);
RELEASE_ASSERT(s, "");
r->n_long = PyString_AsString(s);
return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment