mirror of
https://github.com/python/cpython.git
synced 2025-12-05 00:52:25 +00:00
bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)
https://bugs.python.org/issue38823
This commit is contained in:
parent
5383956583
commit
289cf0fbf7
1 changed files with 2 additions and 0 deletions
|
|
@ -3555,11 +3555,13 @@ PyInit__tkinter(void)
|
||||||
if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
|
if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
|
||||||
str_path = _get_tcl_lib_path();
|
str_path = _get_tcl_lib_path();
|
||||||
if (str_path == NULL && PyErr_Occurred()) {
|
if (str_path == NULL && PyErr_Occurred()) {
|
||||||
|
Py_DECREF(m);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (str_path != NULL) {
|
if (str_path != NULL) {
|
||||||
wcs_path = PyUnicode_AsWideCharString(str_path, NULL);
|
wcs_path = PyUnicode_AsWideCharString(str_path, NULL);
|
||||||
if (wcs_path == NULL) {
|
if (wcs_path == NULL) {
|
||||||
|
Py_DECREF(m);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path);
|
SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue