Skip to content

Fix memory leak caused by stale link tags in GuiGramplet#2353

Open
ztlxltl wants to merge 1 commit into
gramps-project:maintenance/gramps61from
ztlxltl:fix-leak-GuiGramplet._tags
Open

Fix memory leak caused by stale link tags in GuiGramplet#2353
ztlxltl wants to merge 1 commit into
gramps-project:maintenance/gramps61from
ztlxltl:fix-leak-GuiGramplet._tags

Conversation

@ztlxltl

@ztlxltl ztlxltl commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

How to reproduce the leak:

  1. Open the example database.
  2. Switch to the people list view.
  3. Add the Pedigree Gramplet to the sidebar.
  4. Open the config of the Pedigree Gramplet and make sure the "Max generations" is set to 100.
  5. Select Warner, Allen Carl.
  6. Move the mouse over the names in the pedigree.
  7. The names are underlined while the mouse pointer is hovering over them.
  8. Select Warner, Amanda.
  9. Repeat switching between Warner, Allen Carl and Warner, Amanda about 20 (loading the pedigree of both 10 times).
  10. Move the mouse again over the names in the pedigree.
  11. The underlining appears delayed.
  12. Repeat switching between Warner, Allen Carl and Warner, Amanda a few dozens of times, depending on your machine.
  13. Updating the pedigree becomes slower and slower.

The reason for the delays is that PedigreeGramplet.gui._tags is never cleared, but new tags are added every time the content is updated.

This PR fixes this by:

  • setting GuiGramplet._tags to an empty list in GuiGramplet.clear_text()
  • calling GuiGramplet.clear_text() in GuiGramplet.set_text
  • calling Gramplet.clear_text() in PedigreeGramplet.main()
    (Gramplet.clear_text() calls GuiGramplet.clear_text())

I couldn't find a bug report about this. I'm happy to create one if a discussion about this is preferred.

@Nick-Hall

Copy link
Copy Markdown
Member

Did you intend this to target the gramps61 branch?

@ztlxltl

ztlxltl commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

I wasn't sure which version this bug should ideally be fixed in. I'm happy to change it if you prefer 6.1.

@Nick-Hall

Nick-Hall commented Jun 6, 2026

Copy link
Copy Markdown
Member

There will be no further releases in the gramps60 branch.

@ztlxltl ztlxltl force-pushed the fix-leak-GuiGramplet._tags branch from 82ec909 to 898e46e Compare June 7, 2026 06:22
@ztlxltl ztlxltl changed the base branch from master to maintenance/gramps61 June 7, 2026 06:23
@Nick-Hall Nick-Hall added Status: Pending A pull request that is pending review. and removed Status: New labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Pending A pull request that is pending review. Type: Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants