| Index: include/core/SkRefCnt.h
|
| diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
|
| index 87ff7dba9fcd338b424ba404f7abab2632ab4fb4..35f7349778035c4071cacd4979c85c5066e1ddbc 100644
|
| --- a/include/core/SkRefCnt.h
|
| +++ b/include/core/SkRefCnt.h
|
| @@ -160,6 +160,13 @@ template <typename T> static inline void SkSafeUnref(T* obj) {
|
| }
|
| }
|
|
|
| +template<typename T> static inline void SkSafeSetNull(T*& obj) {
|
| + if (NULL != obj) {
|
| + obj->unref();
|
| + obj = NULL;
|
| + }
|
| +}
|
| +
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| /**
|
|
|