Skip to content

[Problem/Bug]: A memory leak issue occurs in WebView2CompositionControl. And problems arise when attempting to display it simultaneously with the WebView2 control. #5090

Open
@Jang-Haemin

Description

@Jang-Haemin

What happened?

Hello,
I am pleased that WebView2CompositionControl, which resolves the airspace issue in WPF applications, has been officially released.
I am developing in a .NET Framework 4.6.2 environment and encountered several issues while using this control to display web pages.

Even after disposing of the WebView2CompositionControl, a memory leak issue occurs. Additionally, when DPI awareness is disabled, attempting to display WebView2 simultaneously may result in WebView2 not being displayed. Detailed information is provided in the Repro steps section.

I would appreciate it if you could check this issue.

Note

Please understand that I used a translation tool, so the message may be difficult to read. Thank you.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

132.0.2957.140

SDK Version

1.0.2957.106

Framework

WPF

Operating System

Windows 11

OS Version

26100.3037 (24H2)

Repro steps

[Issues]

  1. Memory Leak Issue

    • A new window is opened, displaying WebView2CompositionControl.
    • When the window is closed, the Dispose method of WebView2CompositionControl is called, but the object is not reclaimed.
    • This issue does not occur with the WebView2 control.
  2. Issue When Displaying WebView2CompositionControl and WebView2 Simultaneously with DPI Awareness Disabled

    • Open a window containing WebView2CompositionControl while DPI awareness is disabled.
    • After waiting for the web page to load, open another window containing the WebView2 control. The WebView2 control will not be displayed.
    • If you call the WebView2.EnsureCoreWebView2Async() method, the following error will occur:
      "System.Runtime.InteropServices.COMException: The group or resource is not in the correct state to perform the requested operation. (HRESULT: 0x8007139F)"
    • However, this issue does not occur when DPI awareness is enabled!

[Attachments]

I have attached a file to help you easily reproduce this issue.
The project was built in a VS2022, .NET 4.6.2 environment.
Since the program is very simple, I will not provide additional explanations.

Download: WebView2CompTest_20250205.zip

Image

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

Metadata

Metadata

Labels

bugSomething isn't workingtrackedWe are tracking this work internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions