From 41f13d2087a867c1cbf736b905d58a5ce586de3e Mon Sep 17 00:00:00 2001 From: Peter Eliasson Date: Thu, 11 Aug 2022 22:45:03 +0200 Subject: [PATCH] Free library even if proc lookup fails (#108312) --- .../flutter_gallery/windows/runner/win32_window.cpp | 2 +- dev/manual_tests/windows/runner/win32_window.cpp | 2 +- examples/api/windows/runner/win32_window.cpp | 2 +- examples/platform_channel/windows/runner/win32_window.cpp | 2 +- .../templates/app_shared/windows.tmpl/runner/win32_window.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/integration_tests/flutter_gallery/windows/runner/win32_window.cpp b/dev/integration_tests/flutter_gallery/windows/runner/win32_window.cpp index 20c47eacec..4021a2cfd4 100644 --- a/dev/integration_tests/flutter_gallery/windows/runner/win32_window.cpp +++ b/dev/integration_tests/flutter_gallery/windows/runner/win32_window.cpp @@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace diff --git a/dev/manual_tests/windows/runner/win32_window.cpp b/dev/manual_tests/windows/runner/win32_window.cpp index 20c47eacec..4021a2cfd4 100644 --- a/dev/manual_tests/windows/runner/win32_window.cpp +++ b/dev/manual_tests/windows/runner/win32_window.cpp @@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace diff --git a/examples/api/windows/runner/win32_window.cpp b/examples/api/windows/runner/win32_window.cpp index 20c47eacec..4021a2cfd4 100644 --- a/examples/api/windows/runner/win32_window.cpp +++ b/examples/api/windows/runner/win32_window.cpp @@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace diff --git a/examples/platform_channel/windows/runner/win32_window.cpp b/examples/platform_channel/windows/runner/win32_window.cpp index 1089c7c658..600749d7c1 100644 --- a/examples/platform_channel/windows/runner/win32_window.cpp +++ b/examples/platform_channel/windows/runner/win32_window.cpp @@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace diff --git a/packages/flutter_tools/templates/app_shared/windows.tmpl/runner/win32_window.cpp b/packages/flutter_tools/templates/app_shared/windows.tmpl/runner/win32_window.cpp index c10f08dc7d..30b08cc8c9 100644 --- a/packages/flutter_tools/templates/app_shared/windows.tmpl/runner/win32_window.cpp +++ b/packages/flutter_tools/templates/app_shared/windows.tmpl/runner/win32_window.cpp @@ -31,8 +31,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace