Issue #10363: Deallocate global locks in Py_Finalize().
This commit is contained in:
parent
e0aa803714
commit
8db076cf8a
|
@ -10,6 +10,8 @@ What's New in Python 3.2.3?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #10363: Deallocate global locks in Py_Finalize().
|
||||||
|
|
||||||
- Issue #13018: Fix reference leaks in error paths in dictobject.c.
|
- Issue #13018: Fix reference leaks in error paths in dictobject.c.
|
||||||
Patch by Suman Saha.
|
Patch by Suman Saha.
|
||||||
|
|
||||||
|
|
|
@ -252,16 +252,6 @@ _PyImportHooks_Init(void)
|
||||||
Py_DECREF(path_hooks);
|
Py_DECREF(path_hooks);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_PyImport_Fini(void)
|
|
||||||
{
|
|
||||||
Py_XDECREF(extensions);
|
|
||||||
extensions = NULL;
|
|
||||||
PyMem_DEL(_PyImport_Filetab);
|
|
||||||
_PyImport_Filetab = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Locking primitives to prevent parallel imports of the same module
|
/* Locking primitives to prevent parallel imports of the same module
|
||||||
in different threads to return with a partially loaded module.
|
in different threads to return with a partially loaded module.
|
||||||
These calls are serialized by the global interpreter lock. */
|
These calls are serialized by the global interpreter lock. */
|
||||||
|
@ -374,6 +364,21 @@ imp_release_lock(PyObject *self, PyObject *noargs)
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_PyImport_Fini(void)
|
||||||
|
{
|
||||||
|
Py_XDECREF(extensions);
|
||||||
|
extensions = NULL;
|
||||||
|
PyMem_DEL(_PyImport_Filetab);
|
||||||
|
_PyImport_Filetab = NULL;
|
||||||
|
#ifdef WITH_THREAD
|
||||||
|
if (import_lock != NULL) {
|
||||||
|
PyThread_free_lock(import_lock);
|
||||||
|
import_lock = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
imp_modules_reloading_clear(void)
|
imp_modules_reloading_clear(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -150,6 +150,12 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
|
||||||
*p = interp->next;
|
*p = interp->next;
|
||||||
HEAD_UNLOCK();
|
HEAD_UNLOCK();
|
||||||
free(interp);
|
free(interp);
|
||||||
|
#ifdef WITH_THREAD
|
||||||
|
if (interp_head == NULL && head_mutex != NULL) {
|
||||||
|
PyThread_free_lock(head_mutex);
|
||||||
|
head_mutex = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue