From: Giannis Adamopoulos Date: Mon, 1 May 2017 09:35:03 +0000 (+0000) Subject: [EXPLORER] CTrayClockWnd: Fix a leak of font handles. CORE-13155 X-Git-Tag: ReactOS-0.4.6~797 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f23a970e841622e1ecf52221f1317a091c7fd690 [EXPLORER] CTrayClockWnd: Fix a leak of font handles. CORE-13155 svn path=/trunk/; revision=74437 --- diff --git a/reactos/base/shell/explorer/trayntfy.cpp b/reactos/base/shell/explorer/trayntfy.cpp index 00015fa3ba0..2c6c9fccd4b 100644 --- a/reactos/base/shell/explorer/trayntfy.cpp +++ b/reactos/base/shell/explorer/trayntfy.cpp @@ -714,20 +714,19 @@ public: 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); return TRUE;