Skip to content

Commit

Permalink
prevent GC from eating widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
phil294 committed Dec 5, 2022
1 parent df33504 commit b7ddb20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cmd/gtk/gui/gui-add.cr
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ class Cmd::Gtk::Gui::GuiAdd < Cmd::Base
gui.last_x = x
gui.last_y = y
gui.last_widget = widget
# https://github.com/jhass/crystal-gobject/issues/105
gui.widgets << widget
end
end
end
1 change: 1 addition & 0 deletions src/run/display/gui.cr
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ module Run
private class GuiInfo
getter window : Gtk::Window
getter fixed : Gtk::Fixed
getter widgets = [] of Gtk::Widget
property last_widget : Gtk::Widget? = nil
property last_x = 0
property last_y = 0
Expand Down

0 comments on commit b7ddb20

Please sign in to comment.