Skip to content

fix: ModuleModel never frees its tree - #675

Open
horhulenko wants to merge 1 commit into
emsec:masterfrom
horhulenko:fix/module-model-leak
Open

horhulenko wants to merge 1 commit into
emsec:masterfrom
horhulenko:fix/module-model-leak

Conversation

@horhulenko

Copy link
Copy Markdown

ModuleModel had no destructor, so when one was destroyed, its root item and every item under it stayed in memory. On master, this happens every time the content of a grouping is shown and closed.

The fix deletes the root item in ~ModuleModel, the same way GatePinsTreeModel and ModulePinsTreeModel already do. It can't go into BaseTreeModel: ModuleItem removes itself from the model's maps when it's deleted, and those maps would already be gone by then.

Memory left after showing and closing the content of 50 groupings of 1000 gates, 4 times in a row:

round 1 round 2 round 3 round 4
before +10.7 MB +21.4 MB +32.1 MB +42.7 MB
after +0 MB +0 MB +0 MB +0 MB

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant