]> granicus.if.org Git - python/commitdiff
bpo-34794: Fix a leak in Tkinter. (GH-10025)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 23 Oct 2018 19:40:54 +0000 (22:40 +0300)
committerGitHub <noreply@github.com>
Tue, 23 Oct 2018 19:40:54 +0000 (22:40 +0300)
Based on the investigation by Xiang Zhang.

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 93d4dbc5f659a04d31fc5b0c549606dc1c4ba5fe..fa268599876a2cb472a077ad5a699adc58a1f54a 100644 (file)
@@ -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;
     }
 
     {