mirror of https://github.com/python/cpython
Fix a refleak introduced by r66677.
Fix suggested by Amaury Forgeot d'Arc. Closes issue #4003.
This commit is contained in:
parent
cad8da8abd
commit
f40200b214
|
@ -150,16 +150,7 @@ static PY_LONG_LONG CallExternalTimer(ProfilerObject *pObj)
|
|||
}
|
||||
Py_DECREF(o);
|
||||
if (PyErr_Occurred()) {
|
||||
PyObject *context = (PyObject *)pObj;
|
||||
/* May have been called by profiler_dealloc(). */
|
||||
if (Py_REFCNT(context) < 1) {
|
||||
context = PyString_FromString("profiler calling an "
|
||||
"external timer");
|
||||
if (context == NULL) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
PyErr_WriteUnraisable(context);
|
||||
PyErr_WriteUnraisable(pObj->externalTimer);
|
||||
return 0;
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue