Skip to content

Commit

Permalink
Free library even if proc lookup fails (#108312)
Browse files Browse the repository at this point in the history
  • Loading branch information
verath committed Aug 11, 2022
1 parent 341b62d commit 41f13d2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev/manual_tests/windows/runner/win32_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/api/windows/runner/win32_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/platform_channel/windows/runner/win32_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41f13d2

Please sign in to comment.