Skip to content

Commit

Permalink
Dispose ThemedTabControls' brush
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Oct 18, 2023
1 parent bdee232 commit 547f21b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GUI/Controls/ThemedTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ protected override void OnDrawItem(DrawItemEventArgs e)
Rectangle bgRect = e.Bounds;
bgRect.Inflate(-2, -1);
bgRect.Offset(0, 1);
e.Graphics.FillRectangle(new SolidBrush(BackColor), bgRect);
using (SolidBrush bgBrush = new SolidBrush(BackColor))
{
e.Graphics.FillRectangle(bgBrush, bgRect);
}
// e.Index can be invalid (!!), so we need try/catch
try
{
Expand Down

0 comments on commit 547f21b

Please sign in to comment.