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

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: Use ScopedGeneric to define ScopedGDIObject. Created 5 years, 1 month 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
Index: ui/gfx/platform_font_win.cc
diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc
index 1f8ca3e03fa8ee231ce6635eaa5745a7efdc3390..6ee789d3d1f3ab066d9dd5c690e93b84a0e3a58b 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;
}

Powered by Google App Engine
This is Rietveld 408576698