diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/private/SkTemplates.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/private/SkTemplates.h b/include/private/SkTemplates.h index 351fcccfc3..919d160d0d 100644 --- a/include/private/SkTemplates.h +++ b/include/private/SkTemplates.h @@ -294,8 +294,10 @@ public: } SkAutoTMalloc& operator=(SkAutoTMalloc<T>&& that) { - sk_free(fPtr); - fPtr = that.release(); + if (this != &that) { + sk_free(fPtr); + fPtr = that.release(); + } return *this; } |