10000 bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206) · python/cpython@9e4d031 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e4d031

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 <brandtbucher@gmail.com>
1 parent 9a4c5c3 commit 9e4d031

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_tkinter.c

Lines changed: 2 additions & 0 deletions
< 6B8A td data-grid-cell-id="diff-e22af16a12488bb5478ce31dcf26da13ba5a95e051b2440a740ab6bc4ab0c4fd-3554-3555-1" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">3555
Original file line numberDiff line numberDiff line change
@@ -3552,11 +3552,13 @@ PyInit__tkinter(void)
35523552
if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
35533553
str_path = _get_tcl_lib_path();
35543554
if (str_path == NULL && PyErr_Occurred()) {
+
Py_DECREF(m);
35553556
return NULL;
35563557
}
35573558
if (str_path != NULL) {
35583559
wcs_path = PyUnicode_AsWideCharString(str_path, NULL);
35593560
if (wcs_path == NULL) {
3561+
Py_DECREF(m);
35603562
return NULL;
35613563
}
35623564
SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path);

0 commit comments

Comments
 (0)
0