diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-03-31 18:09:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 18:09:10 (GMT) |
commit | dde028480e57bffa83fb084b15ec22490c42ef93 (patch) | |
tree | 3eedc59a43371ad63ae325e13f1b24f0b153cabf | |
parent | 9048d73f7a5c58be21988250c381f866586687a0 (diff) | |
download | cpython-dde028480e57bffa83fb084b15ec22490c42ef93.zip cpython-dde028480e57bffa83fb084b15ec22490c42ef93.tar.gz cpython-dde028480e57bffa83fb084b15ec22490c42ef93.tar.bz2 |
gh-100227: Fix Cleanup of the Extensions Cache (gh-103150)
Decref the key in the right interpreter in _extensions_cache_set().
This is a follow-up to gh-103084. I found the bug while working on gh-101660.
-rw-r--r-- | Python/import.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c index a45b3bfa..24249ae 100644 --- a/Python/import.c +++ b/Python/import.c @@ -983,13 +983,13 @@ _extensions_cache_set(PyObject *filename, PyObject *name, PyModuleDef *def) res = 0; finally: + Py_XDECREF(key); if (oldts != NULL) { _PyThreadState_Swap(interp->runtime, oldts); _PyThreadState_UnbindDetached(main_tstate); Py_DECREF(name); Py_DECREF(filename); } - Py_XDECREF(key); extensions_lock_release(); return res; } |