CmdPal: Fix Dock refresh resource leak - #49742
Merged
Michael Jolley (michaeljolley) merged 3 commits intoAug 14, 2026
Merged
Conversation
JiÅÃ PolÃĄÅĄek (jiripolasek)
force-pushed
the
feature/cmdpal-dock-refresh-resource-leak
branch
from
August 7, 2026 05:18
fcb9e97 to
4e0f483
Compare
JiÅÃ PolÃĄÅĄek (jiripolasek)
marked this pull request as ready for review
August 7, 2026 13:08
JiÅÃ PolÃĄÅĄek (jiripolasek)
requested review from
Michael Jolley (michaeljolley) and
Mike Griese (zadjii-msft)
August 7, 2026 13:16
stack merge was automatically disabled
August 8, 2026 18:43
Pull Request is not mergeable
stack merge was automatically disabled
August 9, 2026 18:48
Pull Request is not mergeable
stack merge was automatically disabled
August 9, 2026 18:48
Pull Request is not mergeable
Michael Jolley (michaeljolley)
force-pushed
the
feature/cmdpal-dock-refresh-resource-leak
branch
from
August 9, 2026 18:56
4e0f483 to
64c72f6
Compare
Collaborator
Author
Collaborator
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Base automatically changed from
dev/jpolasek/f/cmdpal-fix-dock-band-activation-lifecycle
to
main
August 12, 2026 22:33
- Reuse Dock item view models while their source items remain stable. - Coalesce bursty ItemsChanged notifications into a single follow-up refresh. - Clean replaced and discarded view models after applying UI updates. - Prevent queued refreshes from repopulating bands after cleanup. - Handles unavailable UI schedulers without abandoning created view models. - Adds unit tests for reuse and cleanup.
âĶtCache. - ApplyRefresh publishes that prepared cache directly; it no longer reconstructs it via unsafe Items[i] indexing. - Added a many-to-one regression test.
Michael Jolley (michaeljolley)
force-pushed
the
feature/cmdpal-dock-refresh-resource-leak
branch
from
August 12, 2026 22:34
64c72f6 to
1ab69c3
Compare
Dustin L. Howett (DHowett)
approved these changes
Aug 12, 2026
Michael Jolley (michaeljolley)
deleted the
feature/cmdpal-dock-refresh-resource-leak
branch
August 14, 2026 22:44
Collaborator
Author
Boliang Zhang (LegendaryBlair)
pushed a commit
that referenced
this pull request
Aug 17, 2026
## Summary of the Pull Request This PR improves Dock band refresh and partially eliminates our favorite leak: - Reuses Dock item view models while their source items remain stable. - Coalesces bursty ItemsChanged notifications into a single follow-up refresh. - Cleans replaced and discarded view models after applying UI updates. - Prevents queued refreshes from repopulating bands after cleanup. - Handles unavailable UI schedulers without abandoning created view models. - Adds unit tests for reuse and cleanup. ## Pictures? Pictures! Before <img width="1671" height="400" alt="image" src="https://github.com/user-attachments/assets/3a0874e6-eded-44f0-8bc2-bfa223e2888d" /> After <img width="1671" height="716" alt="image" src="https://github.com/user-attachments/assets/1560bfdb-5701-40bd-9f20-d4e885159ab8" /> <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #49428 <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) --> - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7b3fb20d-6e9d-4fef-a5cd-f8921d28c220 ## Validation Steps Performed
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.



Summary of the Pull Request
This PR improves Dock band refresh and partially eliminates our favorite leak:
Pictures? Pictures!
Before
After
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed