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

Unified Diff: ui/gfx/icon_util.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
« no previous file with comments | « printing/image_win.cc ('k') | ui/gfx/path_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/icon_util.cc
diff --git a/ui/gfx/icon_util.cc b/ui/gfx/icon_util.cc
index f9758d39f67626b02bf8a1f470ff8338452ed793..0b6fdf9f2dcbd2da497a6a23b556ee73503670cc 100644
--- a/ui/gfx/icon_util.cc
+++ b/ui/gfx/icon_util.cc
@@ -340,7 +340,7 @@ HICON IconUtil::CreateCursorFromDIB(const gfx::Size& icon_size,
0));
if (dib_size > 0) {
SetDIBits(0,
- bitmap_handle,
+ bitmap_handle.get(),
0,
icon_size.height(),
dib_bits,
@@ -349,7 +349,7 @@ HICON IconUtil::CreateCursorFromDIB(const gfx::Size& icon_size,
}
HBITMAP old_bitmap = reinterpret_cast<HBITMAP>(
- SelectObject(working_dc.Get(), bitmap_handle));
+ SelectObject(working_dc.Get(), bitmap_handle.get()));
SetBkMode(working_dc.Get(), TRANSPARENT);
SelectObject(working_dc.Get(), old_bitmap);
@@ -363,8 +363,8 @@ HICON IconUtil::CreateCursorFromDIB(const gfx::Size& icon_size,
ii.fIcon = FALSE;
ii.xHotspot = hotspot.x();
ii.yHotspot = hotspot.y();
- ii.hbmMask = mask;
- ii.hbmColor = bitmap_handle;
+ ii.hbmMask = mask.get();
+ ii.hbmColor = bitmap_handle.get();
return CreateIconIndirect(&ii);
}
« no previous file with comments | « printing/image_win.cc ('k') | ui/gfx/path_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698