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
When the top-level document of the WebView runs window.chrome.webview.postMessage, and no code in the host process reads the message data, memory is allocated but never released.
Then in the hosting .NET code, either don't add an event handler for CoreWebView2.WebMessageReceived, or don't read the message json.
this.webView.NavigateToString(html);this.webView.CoreWebView2.WebMessageReceived +=(sender,e)=>{// Without executing the line below, memory is allocated but never released.//this.LastMessage = e.WebMessageAsJson;};
Description
When the top-level document of the WebView runs
window.chrome.webview.postMessage
, and no code in the host process reads the message data, memory is allocated but never released.Version
SDK: 1.0.2045.28
Runtime: 117.0.2045.31
Framework: WinForms, .NET Framework 4.8.1
OS: Win11
Regression
Don't know whether this is a regression.
Repro Steps
The fastest way of seeing this behavior is to call
postMessage
with a large data object, like in the example below.Then in the hosting .NET code, either don't add an event handler for
CoreWebView2.WebMessageReceived
, or don't read the message json.The host process leaks unmanaged memory.
AB#46620265
The text was updated successfully, but these errors were encountered: