Index: include/gpu/GrProgramElement.h |
diff --git a/include/gpu/GrProgramElement.h b/include/gpu/GrProgramElement.h |
index 245dcd5fbca582bd689ba27688e9aa45534513de..2cdd1cc5635014e81d3362b4fb8ca3a0600abca7 100644 |
--- a/include/gpu/GrProgramElement.h |
+++ b/include/gpu/GrProgramElement.h |
@@ -44,8 +44,12 @@ public: |
void unref() const { |
this->validate(); |
--fRefCnt; |
- if (0 == fRefCnt && 0 == fPendingExecutions) { |
- SkDELETE(this); |
+ if (0 == fRefCnt) { |
+ if (0 == fPendingExecutions) { |
+ SkDELETE(this); |
+ } else { |
+ this->removeRefs(); |
+ } |
} |
} |
@@ -80,6 +84,8 @@ private: |
void completedExecution() const; |
+ void removeRefs() const; |
+ |
mutable int32_t fRefCnt; |
// Count of deferred executions not yet issued to the 3D API. |
mutable int32_t fPendingExecutions; |