mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-1635741: Fix winreg reference leaks (GH-31560)
Clear also the PyHKEY_Type static type at exit.
This commit is contained in:
parent
e2e72567a1
commit
4657bf7016
2 changed files with 8 additions and 4 deletions
|
@ -2046,11 +2046,9 @@ PyMODINIT_FUNC PyInit_winreg(void)
|
|||
PyHKEY_Type.tp_doc = PyHKEY_doc;
|
||||
if (PyType_Ready(&PyHKEY_Type) < 0)
|
||||
return NULL;
|
||||
Py_INCREF(&PyHKEY_Type);
|
||||
if (PyDict_SetItemString(d, "HKEYType",
|
||||
(PyObject *)&PyHKEY_Type) != 0)
|
||||
return NULL;
|
||||
Py_INCREF(PyExc_OSError);
|
||||
if (PyDict_SetItemString(d, "error",
|
||||
PyExc_OSError) != 0)
|
||||
return NULL;
|
||||
|
@ -2116,5 +2114,3 @@ PyMODINIT_FUNC PyInit_winreg(void)
|
|||
ADD_INT(REG_RESOURCE_REQUIREMENTS_LIST);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue