Fix leak of GrResourceCacheEntry
R=robertphillips@google.com TBR=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/502543002
This commit is contained in:
parent
84cab93186
commit
02e36f2d3f
@ -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;
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ private:
|
||||
SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrResourceCacheEntry);
|
||||
|
||||
friend class GrResourceCache;
|
||||
friend class GrContext;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user