Skip to content

Commit 2c54925

Browse files
bpo-34794: Fix a leak in Tkinter. (GH-10025)
Based on the investigation by Xiang Zhang. (cherry picked from commit df13df4) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent b1b9ee8 commit 2c54925

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed a leak in Tkinter when pass the Python wrapper around Tcl_Obj back to
2+
Tcl/Tk.

‎Modules/_tkinter.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,9 +1153,7 @@ AsObj(PyObject *value)
11531153
}
11541154

11551155
if (PyTclObject_Check(value)) {
1156-
Tcl_Obj *v = ((PyTclObject*)value)->value;
1157-
Tcl_IncrRefCount(v);
1158-
return v;
1156+
return ((PyTclObject*)value)->value;
11591157
}
11601158

11611159
{

0 commit comments

Comments
 (0)