Skip to content

Commit 321def8

Browse files
btharper1st1
authored andcommitted
bpo-36356: Fix memory leak in _asynciomodule.c (pythonGH-16598)
1 parent 303475e commit 321def8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Modules/_asynciomodule.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ static PyObject *asyncio_task_repr_info_func;
3333
static PyObject *asyncio_InvalidStateError;
3434
static PyObject *asyncio_CancelledError;
3535
static PyObject *context_kwname;
36+
static int module_initialized;
3637

3738
static PyObject *cached_running_holder;
3839
static volatile uint64_t cached_running_holder_tsid;
@@ -3247,6 +3248,12 @@ module_init(void)
32473248
if (asyncio_mod == NULL) {
32483249
goto fail;
32493250
}
3251+
if (module_initialized != 0) {
3252+
return 0;
3253+
}
3254+
else {
3255+
module_initialized = 1;
3256+
}
32503257

32513258
current_tasks = PyDict_New();
32523259
if (current_tasks == NULL) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy