Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: include/gpu/GrProgramElement.h

Issue 612293003: Fix ref cnt'ing issue in GrProgramElement. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrProgramElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/gpu/GrProgramElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698