From 3232d9242adbbc7ab59ddf428dbf8258313e7a31 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 28 May 2024 17:35:05 -0700 Subject: [PATCH] fix(borders): destroy hpen and hbrush objects This commit ensures that HPEN and HBRUSH objects created to draw window borders are explicitly destroyed with calls to DeleteObject after EndPaint has been called. re #855 --- komorebi/src/border_manager/border.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/komorebi/src/border_manager/border.rs b/komorebi/src/border_manager/border.rs index 5e143a8b8..69c9d361a 100644 --- a/komorebi/src/border_manager/border.rs +++ b/komorebi/src/border_manager/border.rs @@ -27,6 +27,7 @@ use windows::Win32::Foundation::LRESULT; use windows::Win32::Foundation::WPARAM; use windows::Win32::Graphics::Gdi::BeginPaint; use windows::Win32::Graphics::Gdi::CreatePen; +use windows::Win32::Graphics::Gdi::DeleteObject; use windows::Win32::Graphics::Gdi::EndPaint; use windows::Win32::Graphics::Gdi::InvalidateRect; use windows::Win32::Graphics::Gdi::Rectangle; @@ -210,6 +211,8 @@ impl Border { } } EndPaint(window, &ps); + DeleteObject(hpen); + DeleteObject(hbrush); ValidateRect(window, None); }