Skip to content

GUI widgets are not garbadge collected #2744

@eruvanos

Description

@eruvanos

UIWidgets bind own methods to themselves,
which creates a strong reference, which prevents garbadge collection.

Code to reproduce

import gc
from arcade.gui import UIWidget

widget = UIWidget()
widget.add(UIWidget())

del widget
gc.collect()

amount_of_widgets = len([obj for obj in gc.get_objects() if isinstance(obj, obj_type)])
assert amount_of_widgets == 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    guiRelated to arcade GUI (sub module arcade.gui)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions