noreply at rubyforge.org
2011-May-21 19:34 UTC
[wxruby-development] [ wxruby-Bugs-29218 ] Risk of incorrect deletion of Wx::Menu
Bugs item #29218, was opened at 2011-05-21 19:34 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=29218&group_id=35 Category: Incorrect behavior Group: None Status: Open Resolution: None Priority: 2 Submitted By: Alex Fenton (brokentoy) Assigned to: Alex Fenton (brokentoy) Summary: Risk of incorrect deletion of Wx::Menu Initial Comment: wxRuby protects MenuBar and its associated Menus from GC by marking them via their associated frame. It is possible that a partially-created menu might be incorrectly destroyed before it''s associated with a Frame, if GC is triggered during the set-up of the menu and the Menus are not connected by instance variables. For example menubar = Wx::MenuBar.new(...) menubar.append(SomeMenuSubClass.new) # GC can be triggered here frame.menubar = menubar Tricky to fix in GC without being over-conservative and always preserving menus. Workaround is to connect the MenuBar to the frame early using menubar ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=29218&group_id=35