From 855c4f90d8a1d25ab76f993bdd876ac53a16d3f1 Mon Sep 17 00:00:00 2001 From: Ben Harper Date: Mon, 7 Oct 2019 12:19:58 -0400 Subject: [PATCH] bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598) (cherry picked from commit 321def805abc5b7c92c7e90ca90cb2434fdab855) Co-authored-by: Ben Harper --- Modules/_asynciomodule.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 8eb480fb77eaaf..5261ed3d4c3d06 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -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) { 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