-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
[Windows] GDI resource leaks when using the software renderer code path #107368
Comments
Hi @sevenstars, would it be possible for you to provide a complete minimal reproducible code sample as well as steps to reproduce? Please also provide the output of Thank you |
The leak can be reproduced when the app is using software rasterization on Windows, i.e., in one of scenarios as follows:
I've created a PR to fix this: flutter/engine#34574 |
Hi @sevenstars, I'm not familiar with the scenarios you described above. Can you provide a small sample app that has any of the scenarios described above? |
Thanks for the repro info. I am unable to repro this at the moment so I will label for further insight and update when I am able to repro. Sample for testing https://github.com/flutter/flutter/tree/master/examples/image_list |
I was able to repro this by forcing the software renderer config on my local engine: diff --git a/shell/platform/windows/flutter_windows_engine.cc b/shell/platform/windows/flutter_windows_engine.cc
index ceb4634d43..c0065a6a78 100644
--- a/shell/platform/windows/flutter_windows_engine.cc
+++ b/shell/platform/windows/flutter_windows_engine.cc
@@ -305,9 +305,12 @@ bool FlutterWindowsEngine::RunWithEntrypoint(const char* entrypoint) {
args.custom_dart_entrypoint = entrypoint;
}
- FlutterRendererConfig renderer_config = surface_manager_
- ? GetOpenGLRendererConfig()
- : GetSoftwareRendererConfig();
+ // FlutterRendererConfig renderer_config = surface_manager_
+ // ? GetOpenGLRendererConfig()
+ // : GetSoftwareRendererConfig();
+
+
+ FlutterRendererConfig renderer_config = GetSoftwareRendererConfig();
auto result = embedder_api_.Run(FLUTTER_ENGINE_VERSION, &renderer_config,
&args, this, &engine_); |
…er#34574) Updates `FlutterWindowWin32::OnBitmapSurfaceUpdated` to release the device context using `ReleaseDC`. Fixes: flutter/flutter#107368
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
GDI resource (Device Context) leaks when using the software renderer code path.
This only happens when the app is using software rasterization, i.e., if the embedder explicitly specifies FlutterRendererType::kSoftware or AngleSurfaceManager::Create() somehow fails.
The leak happens in every frame, so after a while, number of leaks will soon reach the default per-process limit of GDI handles and then the app UI will not be responsive.
The text was updated successfully, but these errors were encountered: