projects
/
platform
/
upstream
/
libSkiaSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
727c594
)
Fix self assigment in GrResourceKey
author
bsalomon
<bsalomon@google.com>
Fri, 23 Jan 2015 15:17:55 +0000
(07:17 -0800)
committer
Commit bot
<commit-bot@chromium.org>
Fri, 23 Jan 2015 15:17:55 +0000
(07:17 -0800)
TBR=robertphillips@google.com
BUG=skia:3340
Review URL: https://codereview.chromium.org/
866263007
include/gpu/GrResourceKey.h
patch
|
blob
|
history
diff --git
a/include/gpu/GrResourceKey.h
b/include/gpu/GrResourceKey.h
index
d500a65
..
15d7b43
100644
(file)
--- a/
include/gpu/GrResourceKey.h
+++ b/
include/gpu/GrResourceKey.h
@@
-49,10
+49,12
@@
protected:
}
GrResourceKey& operator=(const GrResourceKey& that) {
- size_t bytes = that.size();
- SkASSERT(SkIsAlign4(bytes));
- fKey.reset(SkToInt(bytes / sizeof(uint32_t)));
- memcpy(fKey.get(), that.fKey.get(), bytes);
+ if (this != &that) {
+ size_t bytes = that.size();
+ SkASSERT(SkIsAlign4(bytes));
+ fKey.reset(SkToInt(bytes / sizeof(uint32_t)));
+ memcpy(fKey.get(), that.fKey.get(), bytes);
+ }
return *this;
}