diff --git a/Misc/NEWS.d/next/Library/2018-09-25-11-04-12.bpo-34794.HGyLx-.rst b/Misc/NEWS.d/next/Library/2018-09-25-11-04-12.bpo-34794.HGyLx-.rst new file mode 100644 index 00000000000000..c58a37b10b8f04 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-09-25-11-04-12.bpo-34794.HGyLx-.rst @@ -0,0 +1,2 @@ +Fixed a memory leak in :class:`Tkinter.Image` when set the *data* or +*maskdata* options. diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index c71ffd016ad881..9b8a4044803290 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -3230,6 +3230,7 @@ Tkapp_CreateByteArray(PyObject *self, PyObject *args) return Tkinter_Error(self); } res = newPyTclObject(obj); + Tcl_DecrRefCount(obj); PyBuffer_Release(&view); return res; }