pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/a8bc03696c7c2c03e1d580633151ec7b850366f3

69241e157469407.css" /> gh-123504: Fix reference leak in finalization of `_tkinter` (#123505) · python/cpython@a8bc036 · GitHub
Skip to content

Commit a8bc036

Browse files
gh-123504: Fix reference leak in finalization of _tkinter (#123505)
1 parent cfbc841 commit a8bc036

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed reference leak in the finalization of :mod:`tkinter`.

Modules/_tkinter.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,17 +3389,28 @@ DisableEventHook(void)
33893389
#endif
33903390
}
33913391

3392+
static int
3393+
module_clear(PyObject *mod)
3394+
{
3395+
Py_CLEAR(Tkinter_TclError);
3396+
Py_CLEAR(Tkapp_Type);
3397+
Py_CLEAR(Tktt_Type);
3398+
Py_CLEAR(PyTclObject_Type);
3399+
return 0;
3400+
}
3401+
3402+
static void
3403+
module_free(void *mod)
3404+
{
3405+
module_clear((PyObject *)mod);
3406+
}
33923407

33933408
static struct PyModuleDef _tkintermodule = {
33943409
PyModuleDef_HEAD_INIT,
3395-
"_tkinter",
3396-
NULL,
3397-
-1,
3398-
moduleMethods,
3399-
NULL,
3400-
NULL,
3401-
NULL,
3402-
NULL
3410+
.m_name = "_tkinter",
3411+
.m_methods = moduleMethods,
3412+
.m_clear = module_clear,
3413+
.m_free = module_free
34033414
};
34043415

34053416
PyMODINIT_FUNC

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy