Skip to content

Commit 48f4f75

Browse files
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
https://bugs.python.org/issue38823 (cherry picked from commit c3f6bdc) Co-authored-by: Brandt Bucher <[email protected]>
1 parent e7c495e commit 48f4f75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Modules/_asynciomodule.c

+4
Original file line numberDiff line numberDiff line change
@@ -3394,24 +3394,28 @@ PyInit__asyncio(void)
33943394
Py_INCREF(&FutureType);
33953395
if (PyModule_AddObject(m, "Future", (PyObject *)&FutureType) < 0) {
33963396
Py_DECREF(&FutureType);
3397+
Py_DECREF(m);
33973398
return NULL;
33983399
}
33993400

34003401
Py_INCREF(&TaskType);
34013402
if (PyModule_AddObject(m, "Task", (PyObject *)&TaskType) < 0) {
34023403
Py_DECREF(&TaskType);
3404+
Py_DECREF(m);
34033405
return NULL;
34043406
}
34053407

34063408
Py_INCREF(all_tasks);
34073409
if (PyModule_AddObject(m, "_all_tasks", all_tasks) < 0) {
34083410
Py_DECREF(all_tasks);
3411+
Py_DECREF(m);
34093412
return NULL;
34103413
}
34113414

34123415
Py_INCREF(current_tasks);
34133416
if (PyModule_AddObject(m, "_current_tasks", current_tasks) < 0) {
34143417
Py_DECREF(current_tasks);
3418+
Py_DECREF(m);
34153419
return NULL;
34163420
}
34173421

0 commit comments

Comments
 (0)