Commit 19cc5b46 authored by yosin@chromium.org's avatar yosin@chromium.org

MenuConfig::Create passes HFONT to Font ctor but this HFONT isn't deleted....

MenuConfig::Create passes HFONT to Font ctor but this HFONT isn't deleted. PlatformFontWin keeps copied HFONT by InitWIthCopyOfHFONT rather than keeping passed HFONT.

BUG=96872
TEST=Manual on Win7


Review URL: http://codereview.chromium.org/7978021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102241 0039d316-1c4b-4281-b951-d872f2087c98
parent 283ba4ca
......@@ -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 @@ MenuConfig* MenuConfig::Create() {
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment