Repository navigation
Release Help/Release Notes WebView when leaving the page - #5131
Merged
Merged
Conversation
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jul 17, 2026
4 tasks done
Mathew Newman (Thenewmanator15)
added a commit
to Thenewmanator15/UniGetUI
that referenced
this pull request
Nov 16, 2026
Leaving the Help or Release Notes page disposes the page and detaches its web view (Devolutions#5131), and hiding the window to the tray now does the same. With Avalonia.Controls.WebView 12.0.0 that had no effect on Windows: the control never destroyed its WebView2 adapter (AdapterDestroyed was never raised), so the msedgewebview2 process cluster stayed alive and every return to the page added another renderer process. Measured on Windows by opening Help and then navigating to Discover: 12.0.0 / 12.0.1: 6 msedgewebview2 processes still running 23 s after leaving; 7 after opening Help again. 12.1.2: 0 processes 3 s after leaving; 6 after opening Help again. The adapter is internal to the package, so it cannot be disposed from our side without reflection. The rest of Avalonia stays on 12.0.4; the solution builds and the test suite gives the same result as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
4 tasks done
Mathew Newman (Thenewmanator15)
added a commit
to Thenewmanator15/UniGetUI
that referenced
this pull request
Nov 16, 2026
Leaving the Help or Release Notes page disposes the page and detaches its web view (Devolutions#5131), and hiding the window to the tray now does the same. With Avalonia.Controls.WebView 12.0.0 that had no effect on Windows: the control never destroyed its WebView2 adapter (AdapterDestroyed was never raised), so the msedgewebview2 process cluster stayed alive and every return to the page added another renderer process. Measured on Windows by opening Help and then navigating to Discover: 12.0.0 / 12.0.1: 6 msedgewebview2 processes still running 23 s after leaving; 7 after opening Help again. 12.1.2: 0 processes 3 s after leaving; 6 after opening Help again. The adapter is internal to the package, so it cannot be disposed from our side without reflection. The rest of Avalonia stays on 12.0.4; the solution builds and the test suite gives the same result as before.
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.
This pull request improves resource management for pages hosting WebView2 controls by ensuring that the associated processes are properly released when navigating away from the Help or Release Notes pages. This change prevents unnecessary resource usage and potential memory leaks by disposing of these pages and their WebView2 instances when they are no longer in use.
Resource management improvements for WebView2 pages:
IDisposableinterface and aDisposemethod to bothHelpPageandReleaseNotesPage, which stops the WebView2 control and detaches it from the UI when the page is disposed.ReleaseWebViewPagemethod inMainWindowViewModelto dispose of and release cached instances ofHelpPageandReleaseNotesPagewhen navigating away from them, ensuring their WebView2 process clusters are freed.MainWindowViewModel.NavigateToto callReleaseWebViewPagewhen switching pages, further ensuring proper cleanup of WebView2 resources.