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

Unified Diff: src/effects/SkColorFilters.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/SkColorFilters.cpp
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 30b550bcc00887ae63f8cd63935d8b5bbcf03aef..1bb9f8fb153b138d64975cffc3b0b6257f41c549 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -369,6 +369,9 @@ bool SkModeColorFilter::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