Issue #20437: Fixed 21 potential bugs when deleting objects references.

This commit is contained in:
Serhiy Storchaka 2014-02-09 13:33:53 +02:00
parent e9c31470e1
commit 505ff755d7
16 changed files with 34 additions and 63 deletions

View file

@ -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)