-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebView2 hosted by NavigationView/Frame/Page crashes app on exit #7632
Comments
In the posted sample if you force a private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
{
Type navigationTargetType = _navigationItemToPageDict[(NavigationViewItem)args.InvokedItemContainer];
if (NavigationFrame.Content?.GetType() != navigationTargetType) { NavigationFrame.Navigate(navigationTargetType, null, new DrillInNavigationTransitionInfo()); }
GC.Collect(); // Forces the crash!!!
} |
The crash is also present in |
The problem here is the underlying WebView2 objects don't get closed soon enough. #7260 has more details, including the workaround to explicitly |
Describe the bug
If a WebView2 control is hosted in a Page which itself is navigated via a NavigationView/Frame and navigation happens a few times, the app crashes on exit with the following error message:
Steps to reproduce the bug
Expected behavior
No response
Screenshots
No response
NuGet package version
1.1.4
Packaging type
Packaged (MSIX)
Windows version
Windows 10 version 21H2 (19044, November 2021 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: