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

lots of memory leaks in ControllerWidget #63

Open
denisri opened this issue Jan 23, 2024 · 2 comments
Open

lots of memory leaks in ControllerWidget #63

denisri opened this issue Jan 23, 2024 · 2 comments
Labels
6.0 bug Something isn't working

Comments

@denisri
Copy link
Contributor

denisri commented Jan 23, 2024

ControllerWidget has many memory leaks and cyclic references which prevent it from being deleted
For instance:

from soma.controller import Controller
from soma.qt_gui.controller import ControllerWidget
c = Controller()
cw = ControllerWidget(c)
cw.show()
del cw

the widget doesn't disappear on del. Plus the Controller instance still has callbacks left, see for instance c.on_fields_change.callbacks is not empty after the del.
I'm currently trying to work on it but there is much work there.
As a first step I could make the ControllerWidget deleted when gc.collect() is called, but the callbacks are still not removed from the controller...

@denisri denisri added bug Something isn't working 6.0 labels Jan 23, 2024
denisri added a commit that referenced this issue Jan 23, 2024
- use weak proxies to all methods used to register callbacks
- garbage collect callbacks lists when deleting ControllerWidget

but I still could not make the widget to be deleted when calling del.
gc.collect() sometimes works however, and the controller is now cleaned
from callbacks to a deleted GUI.
@sapetnioc
Copy link
Contributor

In this branch, we have two ControllerWidget, one in qt_gui and one in web. To answer this issue, we must first decide what to do with them. Should we keep both or make one of them obsolete ? The web has a better support for several complex controller types but could have missing features in its still young API. I do not have a clear idea of the cost to use only web GUI.

@denisri
Copy link
Contributor Author

denisri commented Jan 23, 2024

OK I'm testing the soma.web.ControllerWidget and opening another ticket to discuss issues with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.0 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants