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

Unified Diff: src/gpu/GrContext.cpp

Issue 502543002: Fix leak of GrResourceCacheEntry (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/GrResourceCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index b420df2bc806c0b06fcb7aeff9f18ff5e61e0c1c..63beb7de22645a9c191e36b287f1fb2f60c60e7a 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -548,8 +548,9 @@ void GrContext::unlockScratchTexture(GrTexture* texture) {
if (texture->wasDestroyed()) {
if (texture->getCacheEntry()->key().isScratch()) {
// This texture was detached from the cache but the cache still had a ref to it but
- // not a pointer to it.
- texture->unref();
+ // not a pointer to it. This will unref the texture and delete its resource cache
+ // entry.
+ delete texture->getCacheEntry();
}
return;
}
« no previous file with comments | « no previous file | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698