Skip to content

Commit aaea280

Browse files
[2.7] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)
Based on the investigation by Xiang Zhang. (cherry picked from commit df13df4)
1 parent 4704c33 commit aaea280

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,10 +1205,8 @@ AsObj(PyObject *value)
12051205
}
12061206
#endif
12071207

1208-
if(PyTclObject_Check(value)) {
1209-
Tcl_Obj *v = ((PyTclObject*)value)->value;
1210-
Tcl_IncrRefCount(v);
1211-
return v;
1208+
if (PyTclObject_Check(value)) {
1209+
return ((PyTclObject*)value)->value;
12121210
}
12131211

12141212
{

0 commit comments

Comments
 (0)