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

Unified Diff: src/effects/SkRectShaderImageFilter.cpp

Issue 501563002: Don't leak the shader by reffing twice in SkRectShaderImageFilter. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkRectShaderImageFilter.cpp
diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp
index fe0be12e615c852393a981340d519ec7e42142e4..be3c23ce4b411bedf08559f3383be9020d9125fe 100644
--- a/src/effects/SkRectShaderImageFilter.cpp
+++ b/src/effects/SkRectShaderImageFilter.cpp
@@ -44,7 +44,8 @@ SkRectShaderImageFilter::SkRectShaderImageFilter(SkReadBuffer& buffer)
SkFlattenable* SkRectShaderImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0);
- return Create(buffer.readShader(), &common.cropRect());
+ SkAutoTUnref<SkShader> shader(buffer.readShader());
+ return Create(shader.get(), &common.cropRect());
}
void SkRectShaderImageFilter::flatten(SkWriteBuffer& buffer) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698