]> granicus.if.org Git - python/commitdiff
Fix a refleak introduced by r66678 (backport of r66700).
authorBrett Cannon <bcannon@gmail.com>
Tue, 30 Sep 2008 17:47:50 +0000 (17:47 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 30 Sep 2008 17:47:50 +0000 (17:47 +0000)
Modules/_lsprof.c

index 630b043a8ddcea6a8665ea7ec7c6a8660fe12b73..3f2351229a2e94e3ed5545133db08d90c72623eb 100644 (file)
@@ -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;