Merged PR 8428085: [Git2Git] Fix a GDI font object leak in FontInfo

"Leak in font object 1952 times in last 2k GDI objects created, that lead console to run out of GDI objects."

Fixes MSFT-42906562

Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_we_adept_e4d2 44f47bf7dbe4bff1986ba5fd8940b56f854c58b7
This commit is contained in:
Dustin Howett
2023-02-15 19:15:28 +00:00
parent 3c104440a8
commit 154ac2b916

View File

@@ -398,6 +398,10 @@ CreateBoldFont:
/*
* Store the font info
*/
if (FontInfo[nFont].hFont != nullptr)
{
DeleteObject(FontInfo[nFont].hFont);
}
FontInfo[nFont].hFont = hFont;
FontInfo[nFont].Family = tmFamily;
FontInfo[nFont].Size = SizeActual;