Skip to content
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

[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 opened this issue Feb 5, 2025 · 0 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@Jang-Haemin
Copy link

Jang-Haemin commented Feb 5, 2025

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

@Jang-Haemin Jang-Haemin added the bug Something isn't working label Feb 5, 2025
@Jang-Haemin Jang-Haemin changed the title [Problem/Bug]: A memory leak issue occurs in WebView2CompositionControl, and problems arise when attempting to display it simultaneously with the WebView2 control. [Problem/Bug]: A memory leak issue occurs in WebView2CompositionControl. And problems arise when attempting to display it simultaneously with the WebView2 control. Feb 5, 2025
@prija-microsoft prija-microsoft added the tracked We are tracking this work internally. label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

2 participants