Index: include/core/SkTemplates.h |
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h |
index 6ab44394d898c58cab23f270ae3edf4a0ee64905..c26e4422b5584260783fee63c7cf38fa09cf95db 100644 |
--- a/include/core/SkTemplates.h |
+++ b/include/core/SkTemplates.h |
@@ -107,6 +107,10 @@ template <typename T, int (*P)(T*)> class SkAutoTCallIProc : SkNoncopyable { |
public: |
SkAutoTCallIProc(T* obj): fObj(obj) {} |
~SkAutoTCallIProc() { if (fObj) P(fObj); } |
+ |
+ operator T*() const { return fObj; } |
+ T* operator->() const { SkASSERT(fObj); return fObj; } |
+ |
T* detach() { T* obj = fObj; fObj = NULL; return obj; } |
private: |
T* fObj; |