]> granicus.if.org Git - python/commitdiff
Fix a refleak introduced by r66677.
authorBrett Cannon <bcannon@gmail.com>
Tue, 30 Sep 2008 17:46:03 +0000 (17:46 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 30 Sep 2008 17:46:03 +0000 (17:46 +0000)
Fix suggested by Amaury Forgeot d'Arc.
Closes issue #4003.

Modules/_lsprof.c

index 41c477e388c21571eb8af4ec7d8d2324b66f1a41..14bb8f93e84df254bfd6f1932b88a65ae62169fb 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 (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;