utils/win/SkTScopedComPtr: reset(T*)
authorHal Canary <halcanary@google.com>
Wed, 21 Dec 2016 13:18:51 +0000 (08:18 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 21 Dec 2016 14:56:42 +0000 (14:56 +0000)
Change-Id: I59a687569e2c7b69cdf65ebc9656c7fbffcc32e0
Motivation: to be used by SkXPS.
Reviewed-on: https://skia-review.googlesource.com/6355
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

src/utils/win/SkTScopedComPtr.h

index 5410f5c..105b601 100644 (file)
@@ -57,11 +57,11 @@ public:
 
     T *get() const { return fPtr; }
 
-    void reset() {
-        if (this->fPtr) {
-            this->fPtr->Release();
-            this->fPtr = nullptr;
+    void reset(T* ptr = nullptr) {
+        if (fPtr) {
+            fPtr->Release();
         }
+        fPtr = ptr;
     }
 
     void swap(SkTScopedComPtr<T>& that) {