buttons.rb example crashes on exit
-
lyle (at lylejohnson)
- Tag set to rubyforge
-
Sven A.
- Milestone order changed from 0 to 0
This happens also under Debian Squeeze running ruby 1.9.2-p180 and fxruby-1.6.20.
It seems that the destruction of the application is not working correctly, because
the following change - a bottom-up removal of all children before exiting - fixes
the crash:--- button.rb 2011-04-21 10:05:17.612782000 +0200 +++ button.rb.fixed 2011-04-21 10:07:27.540782516 +0200 @@ -129,7 +129,14 @@ FXRadioButton.new(group4, "Apart", @group4_dt, FXDataTarget::ID_OPTION + 3) quitButton = FXButton.new(controls, "&Quit", :opts => FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X) - quitButton.connect(SEL_COMMAND) { getApp().exit(0) } + quitButton.connect(SEL_COMMAND) { clean_up(self); getApp().exit(0) } + end + + def clean_up(component) + component.children.each do |child| + clean_up(child) + component.removeChild(child) + end end # Load the named icon from a file
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.