mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
https://bugs.python.org/issue38823
This commit is contained in:
parent
d0acdfcf34
commit
c3f6bdc332
1 changed files with 4 additions and 0 deletions
|
|
@ -3387,24 +3387,28 @@ PyInit__asyncio(void)
|
|||
Py_INCREF(&FutureType);
|
||||
if (PyModule_AddObject(m, "Future", (PyObject *)&FutureType) < 0) {
|
||||
Py_DECREF(&FutureType);
|
||||
Py_DECREF(m);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_INCREF(&TaskType);
|
||||
if (PyModule_AddObject(m, "Task", (PyObject *)&TaskType) < 0) {
|
||||
Py_DECREF(&TaskType);
|
||||
Py_DECREF(m);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_INCREF(all_tasks);
|
||||
if (PyModule_AddObject(m, "_all_tasks", all_tasks) < 0) {
|
||||
Py_DECREF(all_tasks);
|
||||
Py_DECREF(m);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_INCREF(current_tasks);
|
||||
if (PyModule_AddObject(m, "_current_tasks", current_tasks) < 0) {
|
||||
Py_DECREF(current_tasks);
|
||||
Py_DECREF(m);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue