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

Unified Diff: views/controls/menu/menu_config_win.cc

Issue 8028019: Merge 102241 - MenuConfig::Create passes HFONT to Font ctor but this HFONT isn't deleted. Platfor... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: Created 9 years, 3 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_config_win.cc
===================================================================
--- views/controls/menu/menu_config_win.cc (revision 102689)
+++ views/controls/menu/menu_config_win.cc (working copy)
@@ -9,6 +9,7 @@
#include <Vssym32.h>
#include "base/logging.h"
+#include "base/win/scoped_gdi_object.h"
#include "base/win/win_util.h"
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/gfx/native_theme_win.h"
@@ -29,10 +30,11 @@
NONCLIENTMETRICS metrics;
base::win::GetNonClientMetrics(&metrics);
l10n_util::AdjustUIFont(&(metrics.lfMenuFont));
- HFONT font = CreateFontIndirect(&metrics.lfMenuFont);
- DLOG_ASSERT(font);
- config->font = gfx::Font(font);
-
+ {
+ base::win::ScopedHFONT font(CreateFontIndirect(&metrics.lfMenuFont));
+ DLOG_ASSERT(font.Get());
+ config->font = gfx::Font(font);
+ }
NativeTheme::ExtraParams extra;
extra.menu_check.is_radio = false;
extra.menu_check.is_selected = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698