Dynamic-Book / drgeo

GNU Dr. Geo, a Dynamic Knowledge Model on geometry
https://www.gnu.org/s/dr-geo
GNU General Public License v3.0
18 stars 1 forks source link

Garbage collection #11

Closed hilaire closed 4 months ago

hilaire commented 9 months ago

When a DrGeo view is closed, there is still garbages not collected as item views and models, FilePreviewMorph, etc. Observe ActiveModels's ActionMaps class variable. It is full of unregistered events.

hilaire commented 5 months ago

The view (DrgMorph) of each math item model set an observer on the model. See if we can avoid it, or remove them properly. See #registersEvents and #release in DrGMorph

hilaire commented 4 months ago

I discard forcing garbage collection of weak references, from the referred model in the observer pattern. It seems stable now, it could be reopen in future in case of an undetected issue.

hilaire commented 4 months ago

Flush the event system at appropriate time with the message #flushEventSystem. It seems to definitely solve the issue.