]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[2.7] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Oct 2018 17:36:02 +0000 (19:36 +0200)
committerGitHub <noreply@github.com>
Sun, 28 Oct 2018 17:36:02 +0000 (19:36 +0200)
Based on the investigation by Xiang Zhang.
(cherry picked from commit df13df41a25765d8a39a77220691698498e758d4)

Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst [new file with mode: 0644]
Modules/_tkinter.c

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 (file)
index 0000000..770807f
--- /dev/null
@@ -0,0 +1,2 @@
+Fixed a leak in Tkinter when pass the Python wrapper around Tcl_Obj back to
+Tcl/Tk.
index c71ffd016ad8814dccde09e6992f4ca01fcc8c35..58640e240f3786c896c0b0a7da92c5e1f2207199 100644 (file)
@@ -1205,10 +1205,8 @@ AsObj(PyObject *value)
     }
 #endif
 
-    if(PyTclObject_Check(value)) {
-        Tcl_Obj *v = ((PyTclObject*)value)->value;
-        Tcl_IncrRefCount(v);
-        return v;
+    if (PyTclObject_Check(value)) {
+        return ((PyTclObject*)value)->value;
     }
 
     {