summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index f0b2a67..acb672b 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -281,10 +281,11 @@ _PyInterpreterState_DeleteExceptMain()
HEAD_LOCK();
PyInterpreterState *interp = _PyRuntime.interpreters.head;
_PyRuntime.interpreters.head = NULL;
- for (; interp != NULL; interp = interp->next) {
+ while (interp != NULL) {
if (interp == _PyRuntime.interpreters.main) {
_PyRuntime.interpreters.main->next = NULL;
_PyRuntime.interpreters.head = interp;
+ interp = interp->next;
continue;
}
@@ -293,7 +294,9 @@ _PyInterpreterState_DeleteExceptMain()
if (interp->id_mutex != NULL) {
PyThread_free_lock(interp->id_mutex);
}
- PyMem_RawFree(interp);
+ PyInterpreterState *prev_interp = interp;
+ interp = interp->next;
+ PyMem_RawFree(prev_interp);
}
HEAD_UNLOCK();
t.git/commit/tests/auto/qabstractprintdialog/tst_qabstractprintdialog.cpp?h=v4.8.5&id=8f52cddb714fbdd616c813045e8ca1f96851bdfc'>8f52cddb714fbdd616c813045e8ca1f96851bdfc (diff)downloadQt-915c8a684b13ace823da28be5da64ae15de4472f.zip
Qt-915c8a684b13ace823da28be5da64ae15de4472f.tar.gz
Qt-915c8a684b13ace823da28be5da64ae15de4472f.tar.bz2
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'tests/auto/qabstractprintdialog/tst_qabstractprintdialog.cpp')
0 files changed, 0 insertions, 0 deletions