diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-25 11:34:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 11:34:00 (GMT) |
commit | 4657bf701670215ce69b89401b2307022a3b0a7d (patch) | |
tree | 92a8bc023e925254e272a621cb07340b2637cde1 /PC | |
parent | e2e72567a1c94c548868f6ee5329363e6036057a (diff) | |
download | cpython-4657bf701670215ce69b89401b2307022a3b0a7d.zip cpython-4657bf701670215ce69b89401b2307022a3b0a7d.tar.gz cpython-4657bf701670215ce69b89401b2307022a3b0a7d.tar.bz2 |
bpo-1635741: Fix winreg reference leaks (GH-31560)
Clear also the PyHKEY_Type static type at exit.
Diffstat (limited to 'PC')
-rw-r--r-- | PC/winreg.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/PC/winreg.c b/PC/winreg.c index 004a89a..2d44c82 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -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; } - - |