populse / soma-base

Miscelaneous all-purpose classes and functions
0 stars 3 forks source link

lots of memory leaks in ControllerWidget #63

Open denisri opened 9 months ago

denisri commented 9 months ago

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...

sapetnioc commented 9 months ago

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 commented 9 months ago

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