Skip to content

Release Help/Release Notes WebView when leaving the page#5131

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/5129-webview-lifecycle
Jul 17, 2026
Merged

Release Help/Release Notes WebView when leaving the page#5131
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/5129-webview-lifecycle

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

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:

  • Added the IDisposable interface and a Dispose method to both HelpPage and ReleaseNotesPage, which stops the WebView2 control and detaches it from the UI when the page is disposed.
  • Introduced the ReleaseWebViewPage method in MainWindowViewModel to dispose of and release cached instances of HelpPage and ReleaseNotesPage when navigating away from them, ensuring their WebView2 process clusters are freed.
  • Updated the navigation logic in MainWindowViewModel.NavigateTo to call ReleaseWebViewPage when switching pages, further ensuring proper cleanup of WebView2 resources.

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit accf456 into main Jul 17, 2026
5 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/5129-webview-lifecycle branch July 17, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unclosable Built-in Web Browser leading to RAM hogging

2 participants