Skip to content

Commit e3185f1

Browse files
committed
Fix destroy method to release ownership of child reference in Group and Window classes
1 parent a0633ca commit e3185f1

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/uing/group.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module UIng
1212
end
1313

1414
def destroy
15+
@child_ref.try &.release_ownership
1516
@child_ref = nil
1617
super
1718
end

src/uing/window.cr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ module UIng
4141
@on_content_size_changed_box = nil
4242
@on_closing_box = nil
4343
@on_focus_changed_box = nil
44+
@child_ref.try &.release_ownership
45+
@child_ref = nil
4446
super
4547
end
4648

0 commit comments

Comments
 (0)