guard for self-assignment in reset()
git-svn-id: http://skia.googlecode.com/svn/trunk@6568 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
26daa8bbee
commit
4efd9d9872
@ -155,8 +155,10 @@ public:
|
|||||||
T* get() const { return fObj; }
|
T* get() const { return fObj; }
|
||||||
|
|
||||||
void reset(T* obj) {
|
void reset(T* obj) {
|
||||||
SkSafeUnref(fObj);
|
if (obj != fObj) {
|
||||||
fObj = obj;
|
SkSafeUnref(fObj);
|
||||||
|
fObj = obj;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void swap(SkAutoTUnref* other) {
|
void swap(SkAutoTUnref* other) {
|
||||||
|
Loading…
Reference in New Issue
Block a user