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

Unified Diff: src/effects/SkColorMatrixFilter.cpp

Issue 1182813002: Don't leak fragment processor in SkColorFilter::asFragmentProcessors implementations. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 6e9da61e1b79b7e620c2ae444c8e8492c6335e3f..894a7b089d378820fa81ec2cae3a01511f9ddf0b 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -562,6 +562,9 @@ bool SkColorMatrixFilter::asFragmentProcessors(GrContext*,
if (frag) {
if (array) {
*array->append() = frag;
+ } else {
+ frag->unref();
+ SkDEBUGCODE(frag = NULL;)
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698