Revert of https://codereview.chromium.org/106563002/
Reason for revert: There's a threading issue I don't quite understand yet. Objects are being deleted after we check they're deleted. Will try again.
R=kkinnunen@nvidia.com, kkinnunen@nvidia.com
TBR=kkinnunen@nvidia.com, kkinnunen@nvidia.com
NOTREECHECKS=true
NOTRY=true
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/134363002
git-svn-id: http://skia.googlecode.com/svn/trunk@13023 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 5e8c2c2..5cf3f82 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -312,8 +312,8 @@
//
// This is complicated and confusing. May try this in the future. For
// now, these resources are just LRU'd as if we never got the message.
- GrResourceEntry* entry;
- while ((entry= fCache.find(invalidated[i].key, GrTFindUnreffedFunctor()))) {
+ GrResourceEntry* entry = fCache.find(invalidated[i].key, GrTFindUnreffedFunctor());
+ if (entry) {
this->deleteResource(entry);
}
}