From bab0f2ff662fa5e94115d2e902d3a694d61ad7f9 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 30 Sep 2008 17:47:50 +0000 Subject: [PATCH] Fix a refleak introduced by r66678 (backport of r66700). --- Modules/_lsprof.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 630b043a8d..3f2351229a 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -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 (context->ob_refcnt < 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; -- 2.50.1