Skip to content

Fix leaks causing menu bar, taskbar, and desktop instances to be retained in memory#899

Merged
josuave merged 2 commits intomasterfrom
fix-misc-leaks
Jun 3, 2025
Merged

Fix leaks causing menu bar, taskbar, and desktop instances to be retained in memory#899
josuave merged 2 commits intomasterfrom
fix-misc-leaks

Conversation

@dremin
Copy link
Collaborator

@dremin dremin commented Jun 3, 2025

Throughout the application lifecycle, we may close or open these windows for various reasons (display changes, preference changes, etc). Unfortunately, previously these windows would always remain in memory after being closed, for multiple reasons. The changes in this PR plug the leaks that were causing this to happen.

Menu bar

  • Fixed event handler and timer leaks in Clock and Search menu bar extras
  • Fixed AppBarWindow leak via ManagedShell update

Desktop

  • Fixed NavigationManager never being disposed
  • Fixed event handler leak in DesktopIcons and NavigationManager

Taskbar

  • Multiple fixes for AppGrabberTaskCategoryProvider
    • Fixed the taskbar creating multiple instances of the provider, when only one is needed at a time, by moving the logic to TaskbarWindowService
    • Fixed event handler leaks in the class
    • Fixed CategoryChanged event for the "All" category causing unnecessary work
    • Also fixed TryGetCategoryDisplayNameByProcId to not return the current window
  • Fixed event handler leak in QuickLaunchButton and Taskbar
  • Fixed task button animations to no longer keep references to the control
  • Fixed AppBarWindow leak via ManagedShell update

dremin added 2 commits June 1, 2025 23:25
Also fix TryGetCategoryDisplayNameByProcId to not return the current window
@dremin dremin requested a review from josuave June 3, 2025 00:29
@josuave josuave merged commit 73c64c8 into master Jun 3, 2025
5 checks passed
@josuave josuave deleted the fix-misc-leaks branch June 3, 2025 00:44
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.

2 participants