| Index: ui/gfx/image/image.cc
|
| diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc
|
| index d7c67ccd65a7274d3ce6865aba7e4284d5c22b8c..c812d8a0e671701fd71e8f6996823ad2c757c343 100644
|
| --- a/ui/gfx/image/image.cc
|
| +++ b/ui/gfx/image/image.cc
|
| @@ -420,10 +420,15 @@ Image::Image(const ImageSkia& image) {
|
| }
|
|
|
| #if defined(OS_IOS)
|
| -Image::Image(UIImage* image)
|
| +Image::Image(UIImage* image) : Image(image, false) {}
|
| +
|
| +Image::Image(UIImage* image, bool retain_argument)
|
| : storage_(new internal::ImageStorage(Image::kImageRepCocoaTouch)) {
|
| - if (image)
|
| + if (image) {
|
| + if (retain_argument)
|
| + base::mac::NSObjectRetain(image);
|
| AddRepresentation(base::MakeUnique<internal::ImageRepCocoaTouch>(image));
|
| + }
|
| }
|
| #elif defined(OS_MACOSX)
|
| Image::Image(NSImage* image) {
|
|
|