bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)
https://bugs.python.org/issue38823
(cherry picked from commit 143a97f641
)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
This commit is contained in:
parent
825e91be04
commit
8a334af133
|
@ -52,6 +52,7 @@ PyInit__contextvars(void)
|
||||||
(PyObject *)&PyContext_Type) < 0)
|
(PyObject *)&PyContext_Type) < 0)
|
||||||
{
|
{
|
||||||
Py_DECREF(&PyContext_Type);
|
Py_DECREF(&PyContext_Type);
|
||||||
|
Py_DECREF(m);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +61,7 @@ PyInit__contextvars(void)
|
||||||
(PyObject *)&PyContextVar_Type) < 0)
|
(PyObject *)&PyContextVar_Type) < 0)
|
||||||
{
|
{
|
||||||
Py_DECREF(&PyContextVar_Type);
|
Py_DECREF(&PyContextVar_Type);
|
||||||
|
Py_DECREF(m);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +70,7 @@ PyInit__contextvars(void)
|
||||||
(PyObject *)&PyContextToken_Type) < 0)
|
(PyObject *)&PyContextToken_Type) < 0)
|
||||||
{
|
{
|
||||||
Py_DECREF(&PyContextToken_Type);
|
Py_DECREF(&PyContextToken_Type);
|
||||||
|
Py_DECREF(m);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue