From be3cfd1bd96d373adb839bff74f2b65b447faa28 Mon Sep 17 00:00:00 2001 From: XXxR4GALXxx <73304497+XXxR4GALXxx@users.noreply.github.com> Date: Sat, 25 Dec 2021 18:45:19 -0300 Subject: [PATCH] Fix "GDI resource leak". (#2694) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "When you no longer need the HBRUSH object, call the DeleteObject function to delete it." https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createsolidbrush 👍 --- examples/common/entry/entry_windows.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index 076bd03b2..62c4ebdfb 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -938,6 +938,7 @@ namespace entry SelectObject(hdc, brush); FillRect(hdc, &rect, brush); ReleaseDC(_hwnd, hdc); + DeleteObject(brush); } void adjust(HWND _hwnd, uint32_t _width, uint32_t _height, bool _windowFrame)