Skip to content

Logic_Project has dangling references after use #28

@rhaschke

Description

@rhaschke

As you correctly stated, @felixkol, when creating a second project, the previous one is not freed as expected, causing the internal marker server to continue publishing keep-alive messages. This is probably due to circular references.
I tried to explicitly call python's garbage collector via gc.collect(), which cleans dangling circular references. However, this triggers a segfault down the line.

I'm afraid that the issue is related to trait-widget bindings. The function trait_widget_binding establishes a bidirectional binding, possibly storing references in both created classes, WidgetTraitBinding and TraitWidgetBinding, like in this toy example.

By the way, why are these classes not stored somehow? Are they just used to establish the binding?

WidgetTraitBinding(hasTrait, traitName, widget, propname, set_trait_post)
TraitWidgetBinding(hasTrait, traitName, widget, propname, set_widget_post)

Here, the Logic_Project is passed to trait_widget_binding:

trait_widget_binding(
self,
"solver_cls",
self.ui_window.tab_widget.solver.solverClassComboBox,
set_widget_post=True,
)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions