]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34794: Fix a leak in Tkinter. (GH-10025)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 23 Oct 2018 20:25:53 +0000 (13:25 -0700)
committerGitHub <noreply@github.com>
Tue, 23 Oct 2018 20:25:53 +0000 (13:25 -0700)
Based on the investigation by Xiang Zhang.
(cherry picked from commit df13df41a25765d8a39a77220691698498e758d4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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 68ee26e790ccaf1feece5f1b2643fe0753a503e5..080b44f78562a729d9ae1a8fd6f6ba765db68c18 100644 (file)
@@ -1153,9 +1153,7 @@ AsObj(PyObject *value)
     }
 
     if (PyTclObject_Check(value)) {
-        Tcl_Obj *v = ((PyTclObject*)value)->value;
-        Tcl_IncrRefCount(v);
-        return v;
+        return ((PyTclObject*)value)->value;
     }
 
     {