diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-24 17:22:26 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-24 17:22:26 +0000 |
commit | 3d805c350c9dc431d71e9156fbbff0b330be4717 (patch) | |
tree | 4ac7984076ae3c968589d97bc7b70e10d871c877 /gfx | |
parent | 65776ee227785343f00145060f6ff0b355e133f1 (diff) | |
download | chromium_src-3d805c350c9dc431d71e9156fbbff0b330be4717.zip chromium_src-3d805c350c9dc431d71e9156fbbff0b330be4717.tar.gz chromium_src-3d805c350c9dc431d71e9156fbbff0b330be4717.tar.bz2 |
Remove use of Skia's safeUnref() in favor of SkSafeUnref(...)
safeUnref() technically has undefined behavior on a null pointer.
TEST=green bots
BUG=none
Review URL: http://codereview.chromium.org/3475007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/native_theme_win.cc | 2 | ||||
-rw-r--r-- | gfx/skia_util.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/gfx/native_theme_win.cc b/gfx/native_theme_win.cc index 6b4a545..5ee77f9 100644 --- a/gfx/native_theme_win.cc +++ b/gfx/native_theme_win.cc @@ -45,7 +45,7 @@ void SetCheckerboardShader(SkPaint* paint, const RECT& align_rect) { matrix.setTranslate(SkIntToScalar(align_rect.left), SkIntToScalar(align_rect.top)); shader->setLocalMatrix(matrix); - paint->setShader(shader)->safeUnref(); + SkSafeUnref(paint->setShader(shader)); } } // namespace diff --git a/gfx/skia_util.h b/gfx/skia_util.h index 26c54bf..00a1d1c 100644 --- a/gfx/skia_util.h +++ b/gfx/skia_util.h @@ -22,9 +22,9 @@ gfx::Rect SkRectToRect(const SkRect& rect); // Creates a vertical gradient shader. The caller owns the shader. // Example usage to avoid leaks: -// paint.setShader(gfx::CreateGradientShader(0, 10, red, blue))->safeUnref(); +// SkSafeUnref(paint.setShader(gfx::CreateGradientShader(0, 10, red, blue))); // -// (The old shader in the paint, if any, needs to be freed, and safeUnref will +// (The old shader in the paint, if any, needs to be freed, and SkSafeUnref will // handle the NULL case.) SkShader* CreateGradientShader(int start_point, int end_point, |