Skip to content

Fix potential memory leak when source listeners are removed from layout.#4060

Closed
corranwebster wants to merge 5 commits intobeeware:mainfrom
corranwebster:fix-source-disconnect-reconnect
Closed

Fix potential memory leak when source listeners are removed from layout.#4060
corranwebster wants to merge 5 commits intobeeware:mainfrom
corranwebster:fix-source-disconnect-reconnect

Conversation

@corranwebster
Copy link
Copy Markdown
Contributor

@corranwebster corranwebster commented Jan 8, 2026

This is a fix for #4030 for DetailedList, Table and Tree.

This adds callbacks to two new private base Widget methods that subclasses can use to do any clean-up before being removed from layout and any restoration needed when being added into the layout. For the DetailedList, Table and Tree we disconnect the listeners on the source on removal, and re-connect and refresh the data when added back.

The selected rows are lost when adding back into the layout, but I think that's OK.

Ref #4030.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@corranwebster corranwebster changed the title Fix potential memory leak when sourse listeners are removed from layout. Fix potential memory leak when source listeners are removed from layout. Jan 8, 2026
@corranwebster
Copy link
Copy Markdown
Contributor Author

I'm going to close this based on the discussion in #4030. Any solution which looks like this will need much deeper architectural changes around widget life-cycles and would essentially be a complete re-write.

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