mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-07 03:13:31 +02:00
fix(stackbar): destroy hpen, hbrush + hfont objs
This commit ensures that HPEN, HBRUSH and HFONT objects which are used to draw stackbar tabs are explicitly destroyed with calls to DeleteObject after ReleaseDC has been called. re #855
This commit is contained in:
@@ -27,6 +27,7 @@ use windows::Win32::Foundation::WPARAM;
|
||||
use windows::Win32::Graphics::Gdi::CreateFontIndirectW;
|
||||
use windows::Win32::Graphics::Gdi::CreatePen;
|
||||
use windows::Win32::Graphics::Gdi::CreateSolidBrush;
|
||||
use windows::Win32::Graphics::Gdi::DeleteObject;
|
||||
use windows::Win32::Graphics::Gdi::DrawTextW;
|
||||
use windows::Win32::Graphics::Gdi::GetDC;
|
||||
use windows::Win32::Graphics::Gdi::Rectangle;
|
||||
@@ -235,6 +236,9 @@ impl Stackbar {
|
||||
}
|
||||
|
||||
ReleaseDC(self.hwnd(), hdc);
|
||||
DeleteObject(hpen);
|
||||
DeleteObject(hbrush);
|
||||
DeleteObject(hfont);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user