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

Unified Diff: printing/emf_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 | « content/common/cursors/webcursor_aurawin.cc ('k') | printing/image_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/emf_win.cc
diff --git a/printing/emf_win.cc b/printing/emf_win.cc
index 8ee1d843e41bdc9d4dcfd1b48252efb60b5dade3..4b00bca7beb2ba32b5ba0c204a55fea3ddcff77b 100644
--- a/printing/emf_win.cc
+++ b/printing/emf_win.cc
@@ -104,12 +104,12 @@ class RasterBitmap {
gfx::Rect bitmap_rect(raster_size);
gfx::CreateBitmapHeader(raster_size.width(), raster_size.height(),
&header_.bmiHeader);
- bitmap_.Set(::CreateDIBSection(context_.Get(), &header_, DIB_RGB_COLORS,
+ bitmap_.reset(CreateDIBSection(context_.Get(), &header_, DIB_RGB_COLORS,
&bits, NULL, 0));
- if (!bitmap_)
+ if (!bitmap_.is_valid())
NOTREACHED() << "Raster bitmap creation for printing failed";
- saved_object_ = ::SelectObject(context_.Get(), bitmap_);
+ saved_object_ = ::SelectObject(context_.Get(), bitmap_.get());
RECT rect = bitmap_rect.ToRECT();
::FillRect(context_.Get(), &rect,
static_cast<HBRUSH>(::GetStockObject(WHITE_BRUSH)));
« no previous file with comments | « content/common/cursors/webcursor_aurawin.cc ('k') | printing/image_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698