diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-03-04 00:33:35 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-03-04 00:33:35 (GMT) |
commit | da13545ebec915c8f22bade82400df12639bc324 (patch) | |
tree | 11f59780e26943c71cfcf9455d20bc4ec7235372 /Modules | |
parent | ef32bc856982b25b869fc6f89a44993ab7e86de1 (diff) | |
download | cpython-da13545ebec915c8f22bade82400df12639bc324.zip cpython-da13545ebec915c8f22bade82400df12639bc324.tar.gz cpython-da13545ebec915c8f22bade82400df12639bc324.tar.bz2 |
Merged revisions 78642 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r78642 | victor.stinner | 2010-03-04 01:29:24 +0100 (jeu., 04 mars 2010) | 10 lines
Merged revisions 78641 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78641 | victor.stinner | 2010-03-04 01:10:12 +0100 (jeu., 04 mars 2010) | 3 lines
Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
reset also the pointer to the current pointer context.
........
................
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_lsprof.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 43cb9b1..a4951c0 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -303,12 +303,17 @@ static void clearEntries(ProfilerObject *pObj) { RotatingTree_Enum(pObj->profilerEntries, freeEntry, NULL); pObj->profilerEntries = EMPTY_ROTATING_TREE; - /* release the memory hold by the free list of ProfilerContexts */ + /* release the memory hold by the ProfilerContexts */ + if (pObj->currentProfilerContext) { + free(pObj->currentProfilerContext); + pObj->currentProfilerContext = NULL; + } while (pObj->freelistProfilerContext) { ProfilerContext *c = pObj->freelistProfilerContext; pObj->freelistProfilerContext = c->previous; free(c); } + pObj->freelistProfilerContext = NULL; } static void |