diff options
author | bsalomon <bsalomon@google.com> | 2014-10-03 05:31:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-03 05:31:41 -0700 |
commit | d012877a6d30ae768f9ccf3239ba09d730cbb6a5 (patch) | |
tree | c5ef04402934c788091c9d94ec058ed88ffb352b /src | |
parent | 6a6567458b303237dd9a528a24829ca849adc1db (diff) |
Fix ref cnt'ing issue in GrProgramElement.
Drop ref on GrGpuResources when GrProgramElement loses its last ref and already has a pending execution.
BUG=skia:2889
Review URL: https://codereview.chromium.org/612293003
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrProgramElement.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gpu/GrProgramElement.cpp b/src/gpu/GrProgramElement.cpp index 2c3085f7e4..89d53e28db 100644 --- a/src/gpu/GrProgramElement.cpp +++ b/src/gpu/GrProgramElement.cpp @@ -31,9 +31,7 @@ void GrProgramElement::convertRefToPendingExecution() const { ++fPendingExecutions; this->unref(); if (0 == fRefCnt) { - for (int i = 0; i < fGpuResources.count(); ++i) { - fGpuResources[i]->removeRef(); - } + this->removeRefs(); } } @@ -53,3 +51,9 @@ void GrProgramElement::completedExecution() const { } } } + +void GrProgramElement::removeRefs() const { + for (int i = 0; i < fGpuResources.count(); ++i) { + fGpuResources[i]->removeRef(); + } +} |