MicrosoftEdge / MicrosoftEdge/WebView2Feedback

App Crash on WebView2 background finalize

Open
#955 12 comments 0 reactions 1 assignee View on GitHub

@champnic is already working on this.

Since Mar 2, 2021.

Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
I have a WPF app using .NET Framework 4.7.2, that contains multiple WebView2 instances. Intermittently, we get an app crash during the finalize of the WebView2 control
Here is the error from Windows Event Viewer.

Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
at System.Windows.Threading.Dispatcher.VerifyAccess()
at Microsoft.Web.WebView2.Wpf.WebView2.get_CoreWebView2()
at Microsoft.Web.WebView2.Wpf.WebView2.Dispose(Boolean)
at System.Windows.Interop.HwndHost.Finalize()

I can't find any way to prevent this from happening.

Version
WebView2 1.0.721-prerelease
.NET Framework 4.7.2

Repro Steps
I believe it eventually happens after a user opens a window with a WebView2 and then closes it. We dispose of the WebView2 instance, but a little while later, the app crashes (during the finalize process).

Screenshots

Additional context

AB#31292515

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.