Skip to content

Crash on Fox::FXApp#exit #48

Description

@cescue

Hello,

I've been learning FXRuby and I've been having issues with interpreter crashes
when calling Fox::FXApp#exit. I don't believe the issue is with the code I'm
using, as it's directly from the book FXRuby: Create Lean and Mean GUIs with
Ruby
, and I haven't been able to find similar issues people have had with this
code before.

  • Platform: Windows 10
  • Ruby version: 2.4 (64-bit)
  • FXRuby version: 1.6.40

Here's a minimal example of such behavior:

require 'fox16'

include Fox

class Application < FXMainWindow
  def initialize(app)
    super(app, 'Exit Crash Demo', width: 600, height: 400)

    menu_bar = FXMenuBar.new(
      self,
      LAYOUT_SIDE_TOP | LAYOUT_FILL_X
    )

    file_menu = FXMenuPane.new(self)

    FXMenuTitle.new(menu_bar, 'File', popupMenu: file_menu)

    exit_cmd = FXMenuCommand.new(file_menu, 'Exit')

    # `app.exit` and `exit` both result in the same behavior
    exit_cmd.connect(SEL_COMMAND) { app.exit }
  end

  def create
    super

    show(PLACEMENT_SCREEN)
  end
end

FXApp.new do |app|
  Application.new(app)
  app.create
  app.run
end

The behavior I'm experiencing can be reproduced by running the script, opening
the "file" menu, and clicking "exit". In Ubuntu, this correctly closes the
application (as far as I can tell; if the interpreter is crashing, it's doing
so silently). In Windows, the application window closes, but is shortly followed
by this message:

image

Judging by other issues in the tracker, this could be an issue with garbage
collection, but I'm unsure how to further proceed. Is this a known issue, or
is there any more information I can provide?

Apologies if this counts as a duplicate of #34 - I didn't want to necro it on
the off-chance the underlying causes differ.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions