Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic_Project has dangling references after use #28

Open
rhaschke opened this issue Apr 29, 2024 · 0 comments
Open

Logic_Project has dangling references after use #28

rhaschke opened this issue Apr 29, 2024 · 0 comments
Assignees

Comments

@rhaschke
Copy link
Member

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,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants