mirror of
https://github.com/python/cpython.git
synced 2025-09-07 01:11:26 +00:00
Issue #20437: Fixed 22 potential bugs when deleting objects references.
This commit is contained in:
commit
dfe98a102e
15 changed files with 34 additions and 63 deletions
|
@ -349,8 +349,7 @@ _imp_release_lock_impl(PyModuleDef *module)
|
|||
void
|
||||
_PyImport_Fini(void)
|
||||
{
|
||||
Py_XDECREF(extensions);
|
||||
extensions = NULL;
|
||||
Py_CLEAR(extensions);
|
||||
#ifdef WITH_THREAD
|
||||
if (import_lock != NULL) {
|
||||
PyThread_free_lock(import_lock);
|
||||
|
@ -598,8 +597,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