Properly dispose tab/title-based resources on tab close #14359
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
The complete tabs model is only disposed and re-created whenever we we need to initialize it (no groups are available), we detect a broken state (we cannot find a tab that should be present) or when the overall tab groups have changed. This re-creation disposes the listeners we have on the current tab bars. However, in this group of listeners we also have some listeners that are only related to a particular tab/widget/title and they do not get properly disposed when a single tab is closed. The goal of this PR is to fix this.
Fixes #14203
How to test
Follow-ups
Review checklist
Reminder for reviewers