mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-17 23:13:55 +01:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user