Skip to content

Commit

Permalink
fix(borders): destroy hpen and hbrush objects
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LGUG2Z committed May 29, 2024
1 parent e57b08d commit 3232d92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions komorebi/src/border_manager/border.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -210,6 +211,8 @@ impl Border {
}
}
EndPaint(window, &ps);
DeleteObject(hpen);
DeleteObject(hbrush);
ValidateRect(window, None);
}

Expand Down

0 comments on commit 3232d92

Please sign in to comment.