diff options
author | 2014-05-02 20:14:59 +0000 | |
---|---|---|
committer | 2014-05-02 20:14:59 +0000 | |
commit | f239d918d8b40a079693fe5b1f172ddf25abd8c1 (patch) | |
tree | 3cf728e50c316a5a32b33317e83c535bc8be038c | |
parent | 1b3beef11b610eeffcde5b011988df0da5078078 (diff) |
guard against self-assignment
BUG=skia:
R=mtklein@google.com, bungeman@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/264793014
git-svn-id: http://skia.googlecode.com/svn/trunk@14545 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkPaint.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 176992f441..0e34be6db8 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -153,6 +153,10 @@ SkPaint::~SkPaint() { } SkPaint& SkPaint::operator=(const SkPaint& src) { + if (this == &src) { + return *this; + } + #define COPY(field) field = src.field #define REF_COPY(field) SkSafeUnref(field); field = SkSafeRef(src.field) |