cnapy-org / CNApy

An integrated visual environment for metabolic modeling with common methods such as FBA, FVA and Elementary Flux Modes, and advanced features such as thermodynamic methods, extended Minimal Cut Sets, OptKnock, RobustKnock, OptCouple and more!
https://cnapy-org.github.io/CNApy-guide/
Apache License 2.0
44 stars 7 forks source link

Schedule old MapViews for deletion #477

Closed sthiele closed 1 year ago

sthiele commented 1 year ago

Scheduling the old map view for deletion seems to solve issue #454

axelvonkamp commented 1 year ago

I have so far not been able to reproduce #454. What makes you think that the MapView maps were not properly cleared? I have noticed that EscherMapView maps are not properly cleared (the web engine processes will not go away) when another project is opened, but this PR does unfortunately not help with that.

sthiele commented 1 year ago

I noticed that the error is triggered (on exit) by an old MapView after a new had already been created. Calling map_tabs.clear() does not delete the MapView objects. https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QTabWidget.html#PySide2.QtWidgets.PySide2.QtWidgets.QTabWidget.clear

Somehow the on on_vbar_changemethod is called on the old map view while the appdata.project doesn't hold the old map data anymore.

Now that you mention it, it might make sense to add similar code to new_project_unchecked