Author: gadamopoulos Date: Mon May 1 09:35:03 2017 New Revision: 74437
URL: http://svn.reactos.org/svn/reactos?rev=74437&view=rev Log: [EXPLORER] CTrayClockWnd: Fix a leak of font handles. CORE-13155
Modified: trunk/reactos/base/shell/explorer/trayntfy.cpp
Modified: trunk/reactos/base/shell/explorer/trayntfy.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/trayntf... ============================================================================== --- trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] Mon May 1 09:35:03 2017 @@ -714,19 +714,18 @@ 0, TMT_TEXTCOLOR, &textColor); + + if (this->hFont != NULL) + DeleteObject(this->hFont); + + SetFont(hFont, FALSE); } else { - NONCLIENTMETRICS ncm = { 0 }; - ncm.cbSize = sizeof(ncm); - SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE); - - hFont = CreateFontIndirectW(&ncm.lfMessageFont); - + /* We don't need to set a font here, our parent will use + * WM_SETFONT to set the right one when themes are not enabled. */ textColor = RGB(0, 0, 0); } - - SetFont(hFont, FALSE);
CloseThemeData(clockTheme);