[wxPython-dev] Problem with MenuItem.Destroy()

Robin Dunn robin at alldunn.com
Mon Dec 18 12:06:13 PST 2006


Paul McNett wrote:
> Paul McNett wrote:
>> Sorry, I don't have time right now to build and test with the preview, 
>> but this happens in wxPython 2.7.2 at least.
>>
>> Modify the example for Menu.py as follows:
>>
>> --- Menu.py.orig        2006-12-08 11:49:41.000000000 -0800
>> +++ Menu.py     2006-12-08 11:48:39.000000000 -0800
>> @@ -81,6 +81,8 @@
>>          item = wx.MenuItem(menu5, 500, "&Smile!\tCtrl+S", "This one 
>> has an icon")
>>          item.SetBitmap(images.getSmilesBitmap())
>>          menu5.AppendItem(item)
>> +        menu5.RemoveItem(item)
>> +        item.Destroy()
>>
>>          # Shortcuts
>>          menu5.Append(501, "Interesting thing\tCtrl+A", "Note the 
>> shortcut!")
>>
>>
>> The call to item.Destroy() causes a segfault. This wasn't the case in 
>> wx2.6.
> 
> Is nobody able to reproduce this? 

Sorry, I thought I had dealt with this bug already but the fix isn't in 
the code currently so maybe it accidentally got reverted or something.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-dev mailing list