Chromium Code Reviews| Index: chrome/browser/win/jumplist.cc |
| diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc |
| index 6dad5579697389d68a137d050de08c7ae6b97199..bd844ce1241cdf395662f925ae43c5bf6a32b6ba 100644 |
| --- a/chrome/browser/win/jumplist.cc |
| +++ b/chrome/browser/win/jumplist.cc |
| @@ -113,9 +113,13 @@ bool CreateIconFile(const gfx::ImageSkia& image_skia, |
| } |
| } |
| + // If it fails to write the icon's content into the empty temp file just |
| + // created at |path|, delete the temp file to avoid leakage. |
| if (!IconUtil::CreateIconFileFromImageFamily(image_family, path, |
| - IconUtil::NORMAL_WRITE)) |
| + IconUtil::NORMAL_WRITE)) { |
| + base::DeleteFile(path, false); |
|
grt (UTC plus 2)
2017/05/01 08:47:32
nit: put the comment above DeleteFile rather than
chengx
2017/05/01 18:05:47
Done.
|
| return false; |
| + } |
| // Add this icon file to the list and return its absolute path. |
| // The IShellLink::SetIcon() function needs the absolute path to an icon. |