Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1395)

Unified Diff: ui/gfx/platform_font_win.cc

Issue 1406403007: Eliminate HICON leaks caused by creating icons from bitmap image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/path_win_unittest.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_win.cc
diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc
index d271f01fb585d90c1e224781e551aaaee90ed1db..57606b86c014291cc4d9c05569ceeb0d253a476a 100644
--- a/ui/gfx/platform_font_win.cc
+++ b/ui/gfx/platform_font_win.cc
@@ -130,7 +130,7 @@ HRESULT FindDirectWriteFontForLOGFONT(IDWriteFactory* factory,
// If this succeeds we return the matched font.
base::win::ScopedGDIObject<HFONT> font(::CreateFontIndirect(font_info));
base::win::ScopedGetDC screen_dc(NULL);
- base::win::ScopedSelectObject scoped_font(screen_dc, font);
+ base::win::ScopedSelectObject scoped_font(screen_dc, font.get());
base::win::ScopedComPtr<IDWriteFontFace> font_face;
hr = gdi_interop->CreateFontFaceFromHdc(screen_dc, font_face.Receive());
@@ -453,7 +453,7 @@ int PlatformFontWin::GetFontSize(const LOGFONT& font_info) {
base::win::ScopedGDIObject<HFONT> font(CreateFontIndirect(&font_info));
TEXTMETRIC font_metrics = {0};
- PlatformFontWin::GetTextMetricsForFont(screen_dc, font, &font_metrics);
+ PlatformFontWin::GetTextMetricsForFont(screen_dc, font.get(), &font_metrics);
return font_metrics.tmAscent;
}
« no previous file with comments | « ui/gfx/path_win_unittest.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698