Skip to content

Commit 42a4359

Browse files
bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)
https://bugs.python.org/issue38823 (cherry picked from commit 289cf0f) Co-authored-by: Brandt Bucher <[email protected]>
1 parent bef2815 commit 42a4359

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_tkinter.c

+2
Original file line numberDiff line numberDiff line change
@@ -3549,11 +3549,13 @@ PyInit__tkinter(void)
35493549
if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
35503550
str_path = _get_tcl_lib_path();
35513551
if (str_path == NULL && PyErr_Occurred()) {
3552+
Py_DECREF(m);
35523553
return NULL;
35533554
}
35543555
if (str_path != NULL) {
35553556
wcs_path = PyUnicode_AsWideCharString(str_path, NULL);
35563557
if (wcs_path == NULL) {
3558+
Py_DECREF(m);
35573559
return NULL;
35583560
}
35593561
SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path);

0 commit comments

Comments
 (0)