mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-19 07:08:48 +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:
1 parent
e57b08d073
commit
3232d9242a
1 file changed
+3
@@ -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