[Python-3000-checkins] r65626 - in python/branches/py3k: Lib/tkinter/__init__.py Misc/NEWS

robert.schuppenies python-3000-checkins at python.org
Sun Aug 10 13:28:17 CEST 2008


Author: robert.schuppenies
Date: Sun Aug 10 13:28:17 2008
New Revision: 65626

Log:
Merged revisions 65622 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65622 | robert.schuppenies | 2008-08-10 13:01:53 +0200 (Sun, 10 Aug 2008) | 4 lines
  
  Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
  menu entries were not deleted.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/tkinter/__init__.py
   python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/tkinter/__init__.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/__init__.py	(original)
+++ python/branches/py3k/Lib/tkinter/__init__.py	Sun Aug 10 13:28:17 2008
@@ -2651,7 +2651,18 @@
         self.insert(index, 'separator', cnf or kw)
     def delete(self, index1, index2=None):
         """Delete menu items between INDEX1 and INDEX2 (not included)."""
+        if index2 is None:
+            index2 = index1
+        cmds = []
+        for i in range(self.index(index1), self.index(index2)+1):
+            if 'command' in self.entryconfig(i):
+                c = str(self.entrycget(i, 'command'))
+                if c in self._tclCommands:
+                    cmds.append(c)
         self.tk.call(self._w, 'delete', index1, index2)
+        for c in cmds:
+            self.deletecommand(c)
+
     def entrycget(self, index, option):
         """Return the resource value of an menu item for OPTION at INDEX."""
         return self.tk.call(self._w, 'entrycget', index, '-' + option)

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Sun Aug 10 13:28:17 2008
@@ -30,6 +30,9 @@
 Library
 -------
 
+- Issue #1342811: Fix leak in Tkinter.Menu.delete. Commands associated to
+  menu entries were not deleted.
+
 - Remove the TarFileCompat class from tarfile.py.
 
 - Issue #2491: os.fdopen is now almost an alias for the built-in open(), and


More information about the Python-3000-checkins mailing list