You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you call Close on a WebView2 control before the control has been unloaded and change the position of the window (changing Overlapped presenter in our case) the app will crash.
The root cause of this looks like the AppWindow.Changed event is unwired in the Unloaded event and not in the Close method. When the window position changes the NotifyParentWindowPositionChanged is called on the CoreWebViewController which causes an access violation which crashes the application.
I have a crash dump file if needed.
A workaround is to call the Close in the Unloaded event of the WebView2.
Steps to reproduce the bug
Maximize window (OverlappedPresenter.Maximize)
Call Close on WebView
Restore Window (OverlappedPresenter.Restore)
Expected behavior
No response
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
Windows version
Windows 11 (23H2): Build 22631
Additional context
No response
The text was updated successfully, but these errors were encountered:
Also. to clarify this isn't related to Window.Close() it's related to the WebView2.Close() method.
For looking at this in WinDbg:
The crash happens here when calling m_coreWebViewController.NotifyParentWindowPositionChanged();
This AppWindow.Changed event is subscribed in the TryCompleteInitialization
But it's only released in the OnUnloaded event
If "WebView2.Close" is called before the OnUnloaded and the AppWindow changes position then m_coreWebViewController.NotifyParentWindowPositionChanged(); is called but since the WebView2 has been closed this is no longer allowed and will throw an access violation.
We were able to work around this by moving our call to Close into the unloaded event and the crash didn't occur.
Describe the bug
If you call Close on a WebView2 control before the control has been unloaded and change the position of the window (changing Overlapped presenter in our case) the app will crash.
The root cause of this looks like the AppWindow.Changed event is unwired in the Unloaded event and not in the Close method. When the window position changes the NotifyParentWindowPositionChanged is called on the CoreWebViewController which causes an access violation which crashes the application.
I have a crash dump file if needed.
A workaround is to call the Close in the Unloaded event of the WebView2.
Steps to reproduce the bug
Expected behavior
No response
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
Windows version
Windows 11 (23H2): Build 22631
Additional context
No response
The text was updated successfully, but these errors were encountered: