mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Issue #20437: Fixed 21 potential bugs when deleting objects references.
This commit is contained in:
parent
e9c31470e1
commit
505ff755d7
16 changed files with 34 additions and 63 deletions
|
@ -253,8 +253,7 @@ imp_release_lock(PyObject *self, PyObject *noargs)
|
|||
void
|
||||
_PyImport_Fini(void)
|
||||
{
|
||||
Py_XDECREF(extensions);
|
||||
extensions = NULL;
|
||||
Py_CLEAR(extensions);
|
||||
#ifdef WITH_THREAD
|
||||
if (import_lock != NULL) {
|
||||
PyThread_free_lock(import_lock);
|
||||
|
@ -497,8 +496,7 @@ _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
|
|||
/* Somebody already imported the module,
|
||||
likely under a different name.
|
||||
XXX this should really not happen. */
|
||||
Py_DECREF(def->m_base.m_copy);
|
||||
def->m_base.m_copy = NULL;
|
||||
Py_CLEAR(def->m_base.m_copy);
|
||||
}
|
||||
dict = PyModule_GetDict(mod);
|
||||
if (dict == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue