summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-25 11:34:00 (GMT)
committerGitHub <noreply@github.com>2022-02-25 11:34:00 (GMT)
commit4657bf701670215ce69b89401b2307022a3b0a7d (patch)
tree92a8bc023e925254e272a621cb07340b2637cde1 /Objects/object.c
parente2e72567a1c94c548868f6ee5329363e6036057a (diff)
downloadcpython-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 'Objects/object.c')
-rw-r--r--Objects/object.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 3044c86..77a4572 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1825,6 +1825,11 @@ _PyTypes_InitState(PyInterpreterState *interp)
}
+
+#ifdef MS_WINDOWS
+extern PyTypeObject PyHKEY_Type;
+#endif
+
static PyTypeObject* static_types[] = {
// The two most important base types: must be initialized first and
// deallocated last.
@@ -1869,6 +1874,9 @@ static PyTypeObject* static_types[] = {
&PyFunction_Type,
&PyGen_Type,
&PyGetSetDescr_Type,
+#ifdef MS_WINDOWS
+ &PyHKEY_Type,
+#endif
&PyInstanceMethod_Type,
&PyListIter_Type,
&PyListRevIter_Type,