[fxruby-users] no clean exit

Björn Bergqvist bjorn.bergqvist at gmail.com
Thu Oct 1 13:35:39 EDT 2009


Hello,
I just thought about it and found a quick way of "solving" the
problem. I just pipe the errors to a file and look at the first rows
of that file:
ruby application.rb 2> err.txt; head -n 10 err.txt
Works for me. Thanks for the help anyway.

Regards
Björn Bergqvist

2009/9/25 Melton, Ryan <rmelton at ball.com>:
> Fox doesn't handle accelerators correctly at shutdown and it causes lots of crashes:
>
> Try calling this function in a SEL_CLOSE handler for your main window:
>
>  def initialize
>    ...
>    self.connect(SEL_CLOSE, method(:cleanup_menu_panes))
>  end
>
>  def cleanup_menu_panes |sender, sel, data|
>    ObjectSpace.each_object(FXMenuPane) do |object|
>      children = []
>      object.each_child do |child|
>        children << child
>      end
>      children.each do |child|
>        object.removeChild(child)
>      end
>    end
>    0
>  end
>
> -----Original Message-----
> From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of James Johnson
> Sent: Friday, September 25, 2009 12:52 PM
> To: fxruby-users at rubyforge.org
> Subject: Re: [fxruby-users] no clean exit
>
>
> On Sep 25, 2009, at 1:00 PM, Björn Bergqvist wrote:
>
>> when I quit the application I'm currently developing there is a lot of
>> messages popping up (see below). I've not discovered any problems when
>> running the application, but have I done something wrong?
>
> I don't think you're doing anything wrong. It doesn't seem to happen on every FXRuby app, but I too have seen it crash on exit (from Ruby
> 1.9.1) in several cases, e.g.
>
>        http://rubyforge.org/tracker/index.php?func=detail&aid=24073&group_id=300&atid=1223
>
> It's been awhile since I've had time to look into this (or much else FXRuby related), but IIRC the problem boils down to the more or less random way that garbage collection occurs during finalization on exit.
> While your program's running, if you (for example) destroy a parent object, FOX will subsequently destroy the child object(s), and the Ruby objects associated with them get cleaned up in an orderly fashion. When the Ruby interpreter is exiting, however, it is possible that the child object will be GC'd before the parent, leaving dangling pointers lying around. I'm not really sure how to fix it at this point.
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users
>
>
>
> This message and any enclosures are intended only for the addressee.  Please
> notify the sender by email if you are not the intended recipient.  If you are
> not the intended recipient, you may not use, copy, disclose, or distribute this
> message or its contents or enclosures to any other person and any such actions
> may be unlawful.  Ball reserves the right to monitor and review all messages
> and enclosures sent to or from this email address.
> _______________________________________________
> fxruby-users mailing list
> fxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/fxruby-users
>


More information about the fxruby-users mailing list