Module: wine Branch: master Commit: 19e27e95b9583ff62c22f29010529f7565fd0df5 URL: https://gitlab.winehq.org/wine/wine/-/commit/19e27e95b9583ff62c22f29010529f7...
Author: Alex Henrie alexhenrie24@gmail.com Date: Fri Apr 12 22:21:52 2024 -0600
explorer: Fix font handle leaks in virtual desktop.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56133
---
programs/explorer/desktop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 25bba7cb7cb..a18c9806d42 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -271,7 +271,8 @@ static void draw_launchers( HDC hdc, RECT update_rect ) DT_CENTER|DT_WORDBREAK|DT_EDITCONTROL|DT_END_ELLIPSIS ); }
- SelectObject( hdc, font ); + font = SelectObject( hdc, font ); + DeleteObject( font ); SetTextColor( hdc, color ); SetBkMode( hdc, mode ); } @@ -433,7 +434,8 @@ static BOOL get_icon_text_metrics( HWND hwnd, TEXTMETRICW *tm ) SystemParametersInfoW( SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0 ); hfont = SelectObject( hdc, CreateFontIndirectW( &lf ) ); ret = GetTextMetricsW( hdc, tm ); - SelectObject( hdc, hfont ); + hfont = SelectObject( hdc, hfont ); + DeleteObject( hfont ); ReleaseDC( hwnd, hdc ); return ret; }