Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

buttons.rb example crashes on exit

#12

When you're running it under Ruby 1.9.1 (which OS?), the buttons.rb program crashes on exit.

Reported by lyle (at lylejohnson) · November 11th, 2009 @ 06:46 PM

State: new
Milestone: none
Assigned to: lyle (at lylejohnson) lyle (at lylejohnson)

Activity

  1. lyle (at lylejohnson)
  2. Sven A.
    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
    

    April 21st, 2011 @ 08:19 AM

  3. Lars Kanis
    Lars Kanis
    • Assigned user set to lyle (at lylejohnson)

    This is solved in 1.6.22.

    February 16th, 2012 @ 08:33 PM

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.