summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Library/2018-10-21-14-53-19.bpo-34794.yt3R4-.rst2
-rw-r--r--Modules/_tkinter.c6
2 files changed, 4 insertions, 4 deletions
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 0000000..770807f
--- /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 c71ffd0..58640e2 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -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;
}
{