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

Unified Diff: printing/image_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 ScopedHICON instead of HICON. 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: printing/image_win.cc
diff --git a/printing/image_win.cc b/printing/image_win.cc
index 1411e160d9bf2ba3ea43190520400220d07c450d..8bf36c7f8b50e477a6475c323c999e35bed9529e 100644
--- a/printing/image_win.cc
+++ b/printing/image_win.cc
@@ -70,8 +70,8 @@ bool Image::LoadMetafile(const Metafile& metafile) {
base::win::ScopedBitmap bitmap(
::CreateDIBSection(hdc.Get(), reinterpret_cast<BITMAPINFO*>(&hdr), 0,
reinterpret_cast<void**>(&bits), NULL, 0));
- DCHECK(bitmap);
- base::win::ScopedSelectObject select_object(hdc.Get(), bitmap);
+ DCHECK(bitmap.is_valid());
+ base::win::ScopedSelectObject select_object(hdc.Get(), bitmap.get());
skia::InitializeDC(hdc.Get());

Powered by Google App Engine
This is Rietveld 408576698