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

Unified Diff: src/gpu/gl/GrGLRenderTarget.cpp

Issue 19580003: Fix leak of GrGLTexID when its owning GrGLTexture has been abandoned. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix Created 7 years, 5 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
Index: src/gpu/gl/GrGLRenderTarget.cpp
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 69d7b9ca580cf398da87dcb29a79a5b370db842a..a6fc1862b32bd0a036a80ffbbc1596b47b52e979 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -20,8 +20,7 @@ void GrGLRenderTarget::init(const Desc& desc,
fTexFBOID = desc.fTexFBOID;
fMSColorRenderbufferID = desc.fMSColorRenderbufferID;
fViewport = viewport;
- fTexIDObj = texID;
- GrSafeRef(fTexIDObj);
+ fTexIDObj.reset(SkSafeRef(texID));
}
namespace {
@@ -95,8 +94,7 @@ void GrGLRenderTarget::onRelease() {
fRTFBOID = 0;
fTexFBOID = 0;
fMSColorRenderbufferID = 0;
- GrSafeUnref(fTexIDObj);
- fTexIDObj = NULL;
+ fTexIDObj.reset(NULL);
INHERITED::onRelease();
}
@@ -104,9 +102,9 @@ void GrGLRenderTarget::onAbandon() {
fRTFBOID = 0;
fTexFBOID = 0;
fMSColorRenderbufferID = 0;
- if (NULL != fTexIDObj) {
+ if (NULL != fTexIDObj.get()) {
fTexIDObj->abandon();
- fTexIDObj = NULL;
+ fTexIDObj.reset(NULL);
}
INHERITED::onAbandon();
}

Powered by Google App Engine
This is Rietveld 408576698