From: Serhiy Storchaka Date: Tue, 23 Oct 2018 19:40:54 +0000 (+0300) Subject: bpo-34794: Fix a leak in Tkinter. (GH-10025) X-Git-Tag: v3.8.0a1~694 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df13df41a25765d8a39a77220691698498e758d4;p=thirdparty%2FPython%2Fcpython.git bpo-34794: Fix a leak in Tkinter. (GH-10025) Based on the investigation by Xiang Zhang. --- diff --git a/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst new file mode 100644 index 000000000000..770807fc7653 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst @@ -0,0 +1,2 @@ +Fixed a leak in Tkinter when pass the Python wrapper around Tcl_Obj back to +Tcl/Tk. diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 93d4dbc5f659..fa268599876a 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1101,9 +1101,7 @@ AsObj(PyObject *value) } if (PyTclObject_Check(value)) { - Tcl_Obj *v = ((PyTclObject*)value)->value; - Tcl_IncrRefCount(v); - return v; + return ((PyTclObject*)value)->value; } {