Skip to content

Commit 41f13d2

Browse files
authored
Free library even if proc lookup fails (#108312)
1 parent 341b62d commit 41f13d2

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

dev/integration_tests/flutter_gallery/windows/runner/win32_window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) {
3535
GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
3636
if (enable_non_client_dpi_scaling != nullptr) {
3737
enable_non_client_dpi_scaling(hwnd);
38-
FreeLibrary(user32_module);
3938
}
39+
FreeLibrary(user32_module);
4040
}
4141

4242
} // namespace

dev/manual_tests/windows/runner/win32_window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) {
3535
GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
3636
if (enable_non_client_dpi_scaling != nullptr) {
3737
enable_non_client_dpi_scaling(hwnd);
38-
FreeLibrary(user32_module);
3938
}
39+
FreeLibrary(user32_module);
4040
}
4141

4242
} // namespace

examples/api/windows/runner/win32_window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) {
3535
GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
3636
if (enable_non_client_dpi_scaling != nullptr) {
3737
enable_non_client_dpi_scaling(hwnd);
38-
FreeLibrary(user32_module);
3938
}
39+
FreeLibrary(user32_module);
4040
}
4141

4242
} // namespace

examples/platform_channel/windows/runner/win32_window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) {
3535
GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
3636
if (enable_non_client_dpi_scaling != nullptr) {
3737
enable_non_client_dpi_scaling(hwnd);
38-
FreeLibrary(user32_module);
3938
}
39+
FreeLibrary(user32_module);
4040
}
4141

4242
} // namespace

packages/flutter_tools/templates/app_shared/windows.tmpl/runner/win32_window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) {
3131
GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
3232
if (enable_non_client_dpi_scaling != nullptr) {
3333
enable_non_client_dpi_scaling(hwnd);
34-
FreeLibrary(user32_module);
3534
}
35+
FreeLibrary(user32_module);
3636
}
3737

3838
} // namespace

0 commit comments

Comments
 (0)