bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)
(cherry picked from commit 321def805a
)
Co-authored-by: Ben Harper <btharper1221@gmail.com>
This commit is contained in:
parent
985ec986e8
commit
13915a3100
|
@ -33,6 +33,7 @@ static PyObject *asyncio_task_repr_info_func;
|
|||
static PyObject *asyncio_InvalidStateError;
|
||||
static PyObject *asyncio_CancelledError;
|
||||
static PyObject *context_kwname;
|
||||
static int module_initialized;
|
||||
|
||||
static PyObject *cached_running_holder;
|
||||
static volatile uint64_t cached_running_holder_tsid;
|
||||
|
@ -3254,6 +3255,12 @@ module_init(void)
|
|||
if (asyncio_mod == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
if (module_initialized != 0) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
module_initialized = 1;
|
||||
}
|
||||
|
||||
current_tasks = PyDict_New();
|
||||
if (current_tasks == NULL) {
|
||||
|
|
Loading…
Reference in New Issue