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

Unified Diff: gm/offsetimagefilter.cpp

Issue 1203613004: Fix memory leak in simple-offsetimagefilter (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
« 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: gm/offsetimagefilter.cpp
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp
index 6645a98b611fd0d6db48bc2397cfc5b8c30065a0..4c8242a4b22741cdd09fa64e46f2cd1292e1f20f 100644
--- a/gm/offsetimagefilter.cpp
+++ b/gm/offsetimagefilter.cpp
@@ -143,7 +143,9 @@ protected:
canvas->save();
canvas->clipRect(*clipR);
}
- p.setImageFilter(imgf);
+ if (imgf) {
+ p.setImageFilter(imgf)->unref();
+ }
p.setColor(0x66FF0000);
canvas->drawRect(r, p);
« 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