Tell the menu's own items apart from the tracked ones by identity - #822
Merged
Conversation
The items MenuBuilder puts in the menu were told from the ones each open adds by their Text, so a solution named after one of them - Options, Exit, Raise issue - had its group header treated as fixed. The header survived the close that removed everything under it, and the next open added another. Matching on text also made the disposal dead. The close removed the tracked items without disposing them, and the next open disposed whatever was still in the collection, which by then was only the fixed six. So every open leaked a menu's worth of controls to the finaliser. Both come from holding the fixed items as themselves. Disposal still happens at the next open rather than during the close that removed them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The items MenuBuilder puts in the menu were told from the ones each open adds by their Text, so a solution named after one of them - Options, Exit, Raise issue - had its group header treated as fixed. The header survived the close that removed everything under it, and the next open added another.
For example, with a pending file from a solution named
Options.sln:and one more inert
Optionsabove the separator every time the menu is opened after that. A group header is built with no action, so it cannot be clicked or even selected, and nothing short of restarting the tray clears them.Matching on text also made the disposal dead. The close removed the tracked items without disposing them, and the next open disposed whatever was still in the collection, which by then was only the fixed six. So every open leaked a menu's worth of controls to the finaliser - which needs no unusual solution name at all.
Both come from holding the fixed items as themselves. Disposal still happens at the next open rather than during the close that removed them.