Charles-François Natali added the comment: Thanks, it's surprising this was never noticed before. Your patch has two issues: - it doesn't clear the thread state before deleting it, which would leak the frame, thread-specific dict, etc - it only clears the thread states after the current thread state: if the current thread is not at the head of the linked list - if it's not the most recently created thread - some thread states won't get cleared
I'm attaching a patch doing the cleanup in PyEval_ReInitThreads(), with test. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17094> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com