Browse Source

Fix "GDI resource leak". (#2694)

"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
👍
XXxR4GALXxx 4 years ago
parent
commit
be3cfd1bd9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      examples/common/entry/entry_windows.cpp

+ 1 - 0
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)